File size: Difference between revisions
Content added Content deleted
Jazzedpineda (talk | contribs) (Omitted EasyLang) |
m (OCaml: update links) |
||
Line 1,139: | Line 1,139: | ||
printFileSize "/input.txt" ;;</syntaxhighlight> |
printFileSize "/input.txt" ;;</syntaxhighlight> |
||
For files greater than |
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 [ |
The module Unix has also a [https://ocaml.org/api/Unix.LargeFile.html LargeFile sub-module]. |
||
=={{header|Oforth}}== |
=={{header|Oforth}}== |