Eio.FileOperations on open files.
Files implement the Flow APIs, which can be used for reading and writing data. This module provides additonal file-specific operations, such as seeking within a file.
To get an open file, use the functions in the Path module.
module Unix_perm : sig ... endTraditional Unix permissions.
module Stat : sig ... endPortable file stats.
val size : _ ro -> Optint.Int63.tsize t returns the size of t.
val pread : _ ro -> file_offset:Optint.Int63.t -> Cstruct.t list -> intpread t ~file_offset bufs performs a single read of t at file_offset into bufs.
It returns the number of bytes read, which may be less than the space in bufs, even if more bytes are available. Use pread_exact instead if you require the buffer to be filled.
To read at the current offset, use Flow.single_read instead.
val pread_exact : _ ro -> file_offset:Optint.Int63.t -> Cstruct.t list -> unitpread_exact t ~file_offset bufs reads from t into bufs until bufs is full.
val pwrite_single : _ rw -> file_offset:Optint.Int63.t -> Cstruct.t list -> intpwrite_single t ~file_offset bufs performs a single write operation, writing data from bufs to location file_offset in t.
It returns the number of bytes written, which may be less than the length of bufs. In most cases, you will want to use pwrite_all instead.
val pwrite_all : _ rw -> file_offset:Optint.Int63.t -> Cstruct.t list -> unitpwrite_all t ~file_offset bufs writes all the data in bufs to location file_offset in t.
val seek : _ ro -> Optint.Int63.t -> [ `Set | `Cur | `End ] -> Optint.Int63.tSet and/or get the current file position.
Like Unix.lseek.
val sync : _ rw -> unitFlush file buffers to disk.
Like Unix.fsync.
val truncate : _ rw -> Optint.Int63.t -> unitSet the length of a file.
Like Unix.ftruncate.
module Pi : sig ... end