langs a-z
This commit is contained in:
parent
db842d013d
commit
d066446780
11389 changed files with 98361 additions and 1020 deletions
7
Task/File-size/OCaml/file-size-1.ocaml
Normal file
7
Task/File-size/OCaml/file-size-1.ocaml
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
let printFileSize filename =
|
||||
let ic = open_in filename in
|
||||
Printf.printf "%d\n" (in_channel_length ic);
|
||||
close_in ic ;;
|
||||
|
||||
printFileSize "input.txt" ;;
|
||||
printFileSize "/input.txt" ;;
|
||||
4
Task/File-size/OCaml/file-size-2.ocaml
Normal file
4
Task/File-size/OCaml/file-size-2.ocaml
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
let printLargeFileSize filename =
|
||||
let ic = open_in filename in
|
||||
Printf.printf "%Ld\n" (LargeFile.in_channel_length ic);
|
||||
close_in ic ;;
|
||||
4
Task/File-size/OCaml/file-size-3.ocaml
Normal file
4
Task/File-size/OCaml/file-size-3.ocaml
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
#load "unix.cma" ;;
|
||||
open Unix ;;
|
||||
Printf.printf "%d\n" (stat "input.txt").st_size ;;
|
||||
Printf.printf "%d\n" (stat "/input.txt").st_size ;;
|
||||
Loading…
Add table
Add a link
Reference in a new issue