Unix.LargeFile(3)
okay so bestie, welcome to Unix.LargeFile(3) from the OCaml library β it's literally the manual page for file operations on large files, and it's giving βbig file? handledβ energy. π
πΈ NAME πΈ
Unix.LargeFile β file operations on large files. That's the name, periodt. π
π¦ MODULE π¦
Module Unix.LargeFile β yes bestie, that's the module name, and it's main character energy. π
π DOCUMENTATION π
Module LargeFile
: sig end
Okay so this sub-module is all about file operations on large files. It's serving 64-bit variants of the functions you already know, so your file-descriptor positioning and file-size changing can handle the big numbers. π
Unix.LargeFile.lseekβ for positioning a file descriptorUnix.LargeFile.truncateandUnix.LargeFile.ftruncateβ for changing the size of a fileUnix.LargeFile.stat,Unix.LargeFile.lstat, andUnix.LargeFile.fstatβ for obtaining information on files
And the way these alternate functions work? They represent positions and sizes by 64-bit integers (type int64) instead of regular integers (type int), thus allowing you to operate on files whose sizes are greater than max_int. No cap, that's the glow-up. β
val lseek : Unix.file_descr -> int64 -> Unix.seek_command -> int64
See lseek.
val truncate : string -> int64 -> unit
See truncate.
val ftruncate : Unix.file_descr -> int64 -> unit
See ftruncate.
π type stats π
And here's the stats record, bestie β every field is accounted for, comments and all: π
type stats = {
st_dev : int ; (* Device number
*)
st_ino : int ; (* Inode number
*)
st_kind : Unix.file_kind ; (* Kind of the file
*)
st_perm : Unix.file_perm ; (* Access rights
*)
st_nlink : int ; (* Number of links
*)
st_uid : int ; (* User id of the owner
*)
st_gid : int ; (* Group ID of the file's group
*)
st_rdev : int ; (* Device ID (if special file)
*)
st_size : int64 ; (* Size in bytes
*)
st_atime : float ; (* Last access time
*)
st_mtime : float ; (* Last modification time
*)
st_ctime : float ; (* Last status change time
*)
}
val stat : string -> stats
val lstat : string -> stats
val fstat : Unix.file_descr -> stats
π that's the whole large-file moment, bestie! this page was brought to you by OCamldoc, dated 2026-06-22. mwah! π β¨
π¦ where this page comes from
- arch rolling: ocaml 5.5.0-1 Β· LGPL2.1 AND custom: QPL-1.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms