Optional offset: null | numberOptional length: null | numberOptional position: null | numberWrite buffer to the file specified by fd.
offset determines the part of the buffer to be written, and length is
an integer specifying the number of bytes to write.
position refers to the offset from the beginning of the file where this data
should be written. If typeof position !== 'number', the data will be written
at the current position. See pwrite(2).
The callback will be given three arguments (err, bytesWritten, buffer) wherebytesWritten specifies how many bytes were written from buffer.
If this method is invoked as its util.promisify() ed version, it returns
a promise for an Object with bytesWritten and buffer properties.
It is unsafe to use fs.write() multiple times on the same file without waiting
for the callback. For this scenario, createWriteStream is
recommended.
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.
Write buffer to the file specified by fd.
offset determines the part of the buffer to be written, and length is
an integer specifying the number of bytes to write.
position refers to the offset from the beginning of the file where this data
should be written. If typeof position !== 'number', the data will be written
at the current position. See pwrite(2).
The callback will be given three arguments (err, bytesWritten, buffer) wherebytesWritten specifies how many bytes were written from buffer.
If this method is invoked as its util.promisify() ed version, it returns
a promise for an Object with bytesWritten and buffer properties.
It is unsafe to use fs.write() multiple times on the same file without waiting
for the callback. For this scenario, createWriteStream is
recommended.
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.
Write buffer to the file specified by fd.
offset determines the part of the buffer to be written, and length is
an integer specifying the number of bytes to write.
position refers to the offset from the beginning of the file where this data
should be written. If typeof position !== 'number', the data will be written
at the current position. See pwrite(2).
The callback will be given three arguments (err, bytesWritten, buffer) wherebytesWritten specifies how many bytes were written from buffer.
If this method is invoked as its util.promisify() ed version, it returns
a promise for an Object with bytesWritten and buffer properties.
It is unsafe to use fs.write() multiple times on the same file without waiting
for the callback. For this scenario, createWriteStream is
recommended.
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.
Write buffer to the file specified by fd.
offset determines the part of the buffer to be written, and length is
an integer specifying the number of bytes to write.
position refers to the offset from the beginning of the file where this data
should be written. If typeof position !== 'number', the data will be written
at the current position. See pwrite(2).
The callback will be given three arguments (err, bytesWritten, buffer) wherebytesWritten specifies how many bytes were written from buffer.
If this method is invoked as its util.promisify() ed version, it returns
a promise for an Object with bytesWritten and buffer properties.
It is unsafe to use fs.write() multiple times on the same file without waiting
for the callback. For this scenario, createWriteStream is
recommended.
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.
Write buffer to the file specified by fd.
offset determines the part of the buffer to be written, and length is
an integer specifying the number of bytes to write.
position refers to the offset from the beginning of the file where this data
should be written. If typeof position !== 'number', the data will be written
at the current position. See pwrite(2).
The callback will be given three arguments (err, bytesWritten, buffer) wherebytesWritten specifies how many bytes were written from buffer.
If this method is invoked as its util.promisify() ed version, it returns
a promise for an Object with bytesWritten and buffer properties.
It is unsafe to use fs.write() multiple times on the same file without waiting
for the callback. For this scenario, createWriteStream is
recommended.
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.
Write buffer to the file specified by fd.
offset determines the part of the buffer to be written, and length is
an integer specifying the number of bytes to write.
position refers to the offset from the beginning of the file where this data
should be written. If typeof position !== 'number', the data will be written
at the current position. See pwrite(2).
The callback will be given three arguments (err, bytesWritten, buffer) wherebytesWritten specifies how many bytes were written from buffer.
If this method is invoked as its util.promisify() ed version, it returns
a promise for an Object with bytesWritten and buffer properties.
It is unsafe to use fs.write() multiple times on the same file without waiting
for the callback. For this scenario, createWriteStream is
recommended.
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.
Write buffer to the file specified by fd.
offset determines the part of the buffer to be written, and length is
an integer specifying the number of bytes to write.
position refers to the offset from the beginning of the file where this data
should be written. If typeof position !== 'number', the data will be written
at the current position. See pwrite(2).
The callback will be given three arguments (err, bytesWritten, buffer) wherebytesWritten specifies how many bytes were written from buffer.
If this method is invoked as its util.promisify() ed version, it returns
a promise for an Object with bytesWritten and buffer properties.
It is unsafe to use fs.write() multiple times on the same file without waiting
for the callback. For this scenario, createWriteStream is
recommended.
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.
Optional buffer: TBufferOptional offset: numberOptional length: numberOptional position: null | numberWrite buffer to the file specified by fd.
offset determines the part of the buffer to be written, and length is
an integer specifying the number of bytes to write.
position refers to the offset from the beginning of the file where this data
should be written. If typeof position !== 'number', the data will be written
at the current position. See pwrite(2).
The callback will be given three arguments (err, bytesWritten, buffer) wherebytesWritten specifies how many bytes were written from buffer.
If this method is invoked as its util.promisify() ed version, it returns
a promise for an Object with bytesWritten and buffer properties.
It is unsafe to use fs.write() multiple times on the same file without waiting
for the callback. For this scenario, createWriteStream is
recommended.
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.
Optional position: null | numberOptional encoding: null | BufferEncodingAsynchronously writes buffer to the file referenced by the supplied file descriptor.
A file descriptor.
Optional buffer: TBufferOptional offset: numberThe part of the buffer to be written. If not supplied, defaults to 0.
Optional length: numberThe number of bytes to write. If not supplied, defaults to buffer.length - offset.
Optional position: null | numberThe offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position.
Asynchronously writes string to the file referenced by the supplied file descriptor.
A file descriptor.
A string to write.
Optional position: null | numberThe offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position.
Optional encoding: null | BufferEncodingThe expected string encoding.
Generated using TypeDoc
Write
bufferto the file specified byfd.offsetdetermines the part of the buffer to be written, andlengthis an integer specifying the number of bytes to write.positionrefers to the offset from the beginning of the file where this data should be written. Iftypeof position !== 'number', the data will be written at the current position. Seepwrite(2).The callback will be given three arguments
(err, bytesWritten, buffer)wherebytesWrittenspecifies how many bytes were written frombuffer.If this method is invoked as its
util.promisify()ed version, it returns a promise for anObjectwithbytesWrittenandbufferproperties.It is unsafe to use
fs.write()multiple times on the same file without waiting for the callback. For this scenario, createWriteStream is recommended.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.