FileHandle
Properties
Functions
Alias of filehandle.writeFile().
Alias of filehandle.writeFile().
Modifies the permissions on the file. See chmod(2).
Changes the ownership of the file. A wrapper for chown(2).
Closes the file handle after waiting for any pending operation on the handle to complete.
Unlike the 16 KiB default highWaterMark for a stream.Readable, the stream returned by this method has a default highWaterMark of 64 KiB.
options may also include a start option to allow writing data at some position past the beginning of the file, allowed values are in the \[0, Number.MAX_SAFE_INTEGER\] range. Modifying a file rather than replacing it may require the flags open option to be set to r+ rather than the default r. The encoding can be any one of those accepted by Buffer.
Forces all currently queued I/O operations associated with the file to the operating system's synchronized I/O completion state. Refer to the POSIX fdatasync(2) documentation for details.
Returns a byte-oriented ReadableStream that may be used to read the file's contents.
Reads data from the file and stores that in the given buffer.
Asynchronously reads the entire contents of a file. The underlying file will not be closed automatically. The FileHandle must have been opened for reading.
Asynchronously reads the entire contents of a file. The underlying file will not be closed automatically. The FileHandle must have been opened for reading.
Asynchronously reads the entire contents of a file.
Convenience method to create a readline interface and stream over the file. See filehandle.createReadStream() for the options.
Read from a file and write to an array of ArrayBufferView s
Request that all data for the open file descriptor is flushed to the storage device. The specific implementation is operating system and device specific. Refer to the POSIX fsync(2) documentation for more detail.
Truncates the file.
Change the file system timestamps of the object referenced by the FileHandle then fulfills the promise with no arguments upon success.
Write buffer to the file.
Asynchronously writes data to a file, replacing the file if it already exists. data can be a string, a buffer, an AsyncIterable, or an Iterable object. The promise is fulfilled with no arguments upon success.
Asynchronously writes data to a file, replacing the file if it already exists. data can be a string, a buffer, an AsyncIterable, or an Iterable object. The promise is fulfilled with no arguments upon success.
Write an array of ArrayBufferView s to the file.