Close the file. The actual close happens asynchronously. The handler will be called when the close is complete, or an error occurs.
Close the file. The actual close happens asynchronously. The handler will be called when the close is complete, or an error occurs.
Same as {@link WriteStream#end} but with an handler
called when the operation completes
Same as {@link WriteStream#end} but with an handler
called when the operation completes
Same as but with an handler
called when the operation completes
Same as but with an handler
called when the operation completes
Same as {@link AsyncFile#flush} but the handler will be called when the flush is complete or if an error occurs
Same as {@link AsyncFile#flush} but the handler will be called when the flush is complete or if an error occurs
Like {@link AsyncFile#lock} but the handler
will be called when the operation is complete or if an error occurs.
Like {@link AsyncFile#lock} but the handler
will be called when the operation is complete or if an error occurs.
Like {@link AsyncFile#lock} but the handler
will be called when the operation is complete or if an error occurs.
Like {@link AsyncFile#lock} but the handler
will be called when the operation is complete or if an error occurs.
Pipe this ReadStream
to the WriteStream
.
Elements emitted by this stream will be written to the write stream until this stream ends or fails.
Once this stream has ended or failed, the write stream will be ended and the handler
will be
called with the result.
Pipe this ReadStream
to the WriteStream
.
Elements emitted by this stream will be written to the write stream until this stream ends or fails.
Once this stream has ended or failed, the write stream will be ended and the handler
will be
called with the result.
Reads length
bytes of data from the file at position position
in the file, asynchronously.
The read data will be written into the specified Buffer buffer
at position offset
.
If data is read past the end of the file then zero bytes will be read.
When multiple reads are invoked on the same file there are no guarantees as to order in which those reads actually occur.
The handler will be called when the close is complete, or if an error occurs.
Reads length
bytes of data from the file at position position
in the file, asynchronously.
The read data will be written into the specified Buffer buffer
at position offset
.
If data is read past the end of the file then zero bytes will be read.
When multiple reads are invoked on the same file there are no guarantees as to order in which those reads actually occur.
The handler will be called when the close is complete, or if an error occurs.
Sets the buffer size that will be used to read the data from the file. Changing this value will impact how much the data will be read at a time from the file system.
Sets the number of bytes that will be read when using the file as a ReadStream.
Sets the position from which data will be read from when using the file as a ReadStream.
Sets the position from which data will be written when using the file as a WriteStream.
Like {@link AsyncFile#size} but the handler
will be called when the operation is complete or if an error occurs.
Like {@link AsyncFile#size} but the handler
will be called when the operation is complete or if an error occurs.
Like {@link AsyncFile#size} but blocking.
Try to acquire a non-shared lock on the entire file.
Try to acquire a lock on a portion of this file.
Same as but with an handler
called when the operation completes
Same as but with an handler
called when the operation completes
Write a Buffer to the file at position position
in the file, asynchronously.
If position
lies outside of the current size
of the file, the file will be enlarged to encompass it.
When multiple writes are invoked on the same file there are no guarantees as to order in which those writes actually occur
The handler will be called when the write is complete, or if an error occurs.
Write a Buffer to the file at position position
in the file, asynchronously.
If position
lies outside of the current size
of the file, the file will be enlarged to encompass it.
When multiple writes are invoked on the same file there are no guarantees as to order in which those writes actually occur
The handler will be called when the write is complete, or if an error occurs.
This will return true
if there are more bytes in the write queue than the value set using {@link AsyncFile#setWriteQueueMaxSize}
Generated using TypeDoc
Represents a file on the file-system which can be read from, or written to asynchronously.
This class also implements ReadStream and WriteStream. This allows the data to be piped to and from other streams, e.g. an HttpClientRequest instance, using the Pipe class