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 descriptor
  • Unix.LargeFile.truncate and Unix.LargeFile.ftruncate β€” for changing the size of a file
  • Unix.LargeFile.stat, Unix.LargeFile.lstat, and Unix.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