Opens or creates a file by name. By default, an existing file is opened in read-only mode.
Takes control of a file handle.
Closes the stream if it is open. Otherwise, it does nothing.
Copying is disabled because references counting should be used instead.
Platform-specific file handle. On Posix systems, this is the file descriptor int. On Windows, this is a HANDLE.
Closes the stream if it is open. Otherwise, it does nothing.
Copies the rest of this file to the other. The positions of both files are appropriately incremented, as if one called read()/write() to copy the file. The number of copied bytes is returned.
Locks the specified file segment. If the file segment is already locked by another process, waits until the existing lock is released.
Reads data from the file.
Vectorized read.
Seeks relative to a position.
Syncs all modified cached data of the file to disk. This includes data written to the file as well as meta data (e.g., last modified time, last access time).
Like lock, but returns false immediately if the lock is held by another process. Returns true if the specified region in the file was successfully locked.
Writes data to the file.
Vectorized write.
Returns the internal file handle. On POSIX, this is a file descriptor. On Windows, this is an object handle.
Returns true if the file is open.
Checks if the file refers to a terminal.
Gets the size of the file.
Sets the length of the file. This can be used to truncate or extend the length of the file. If the file is extended, the new segment is not guaranteed to be initialized to zeros.
Duplicates the given platform-specific file handle. This is useful for taking non-exclusive control over a file handle.
Platform-specific file handle. On Posix systems, this is the file descriptor int. On Windows, this is a HANDLE.
A cross-platform wrapper around low-level file operations.