Protected
_bufferProtected
_positionCurrent position
Protected
closedWhether the file is open or closed
Protected
dirtyWhether the file has changes which have not been written to the FS
Readonly
flagProtected
fsThe file system that created the file.
Readonly
pathPath to the file
Readonly
statsThe stats object for the given file. PreloadFile will mutate this object. Note that this object must contain the appropriate mode that the file was opened as.
Get the underlying buffer for this file. Mutating not recommended and will mess up dirty tracking.
Get the current file position.
We emulate the following bug mentioned in the Node documentation:
On Linux, positional writes don't work when the file is opened in append mode. The kernel ignores the position argument and always appends the data to the end of the file.
The current file position.
Set the file position.
new position
Protected
_readInternal
Set the file type
Internal
Set the file type
Protected
_truncateProtected
_writeProtected
disposeRead data from the file.
The buffer that the data will be written to.
Optional
offset: numberThe offset within the buffer where writing will start.
Optional
length: numberAn integer specifying the number of bytes to read.
Optional
position: numberAn integer specifying where to begin reading from in the file. If position is null, data will be read from the current file position.
Read data from the file.
The buffer that the data will be written to.
Optional
offset: numberThe offset within the buffer where writing will start.
Optional
length: numberAn integer specifying the number of bytes to read.
Optional
position: numberAn integer specifying where to begin reading from in the file. If position is null, data will be read from the current file position.
number of bytes written
Write buffer to the file. Note that it is unsafe to use fs.write multiple times on the same file without waiting for the callback.
Uint8Array containing the data to write to the file.
Optional
offset: numberOffset in the buffer to start reading data from.
Optional
length: numberThe amount of bytes to write to the file.
Optional
position: numberOffset from the beginning of the file where this data should be written. If position is null, the data will be written at the current position.
Write buffer to the file. Note that it is unsafe to use fs.writeSync multiple times on the same file without waiting for the callback.
Uint8Array containing the data to write to the file.
Offset in the buffer to start reading data from.
The amount of bytes to write to the file.
Offset from the beginning of the file where this data should be written. If position is null, the data will be written at the current position.
bytes written
For the filesystems which do not sync to anything..