File size: Difference between revisions

Content added Content deleted
(Omitted EasyLang)
m (OCaml: update links)
Line 1,139: Line 1,139:
printFileSize "/input.txt" ;;</syntaxhighlight>
printFileSize "/input.txt" ;;</syntaxhighlight>


For files greater than Pervasives.max_int, one can use the module [http://caml.inria.fr/pub/docs/manual-ocaml/libref/Pervasives.LargeFile.html Pervasives.LargeFile]:
For files greater than max_int, one can use the module [https://ocaml.org/api/Stdlib.LargeFile.html Stdlib.LargeFile]:
<syntaxhighlight lang="ocaml">let printLargeFileSize filename =
<syntaxhighlight lang="ocaml">let printLargeFileSize filename =
let ic = open_in filename in
let ic = open_in filename in
Line 1,151: Line 1,151:
Printf.printf "%d\n" (stat "/input.txt").st_size ;;</syntaxhighlight>
Printf.printf "%d\n" (stat "/input.txt").st_size ;;</syntaxhighlight>


The module Unix has also a [http://caml.inria.fr/pub/docs/manual-ocaml/libref/Unix.LargeFile.html LargeFile sub-module].
The module Unix has also a [https://ocaml.org/api/Unix.LargeFile.html LargeFile sub-module].


=={{header|Oforth}}==
=={{header|Oforth}}==