write< TBuffer > ( fd: number , buffer: TBuffer , offset: undefined | null | number , length: undefined | null | number , position: undefined | null | number , callback: ( ( err: null | ErrnoException , written: number , buffer: TBuffer ) => void ) ) : void
Parameters
fd: number
buffer: TBuffer
offset: undefined | null | number
length: undefined | null | number
position: undefined | null | number
callback: ( ( err: null | ErrnoException , written: number , buffer: TBuffer ) => void )
( err: null | ErrnoException , written: number , buffer: TBuffer ) : void
Parameters
written: number
buffer: TBuffer
Returns void
Returns void
Defined in node_modules/@types/node/fs.d.ts:2125
write< TBuffer > ( fd: number , buffer: TBuffer , offset: undefined | null | number , length: undefined | null | number , callback: ( ( err: null | ErrnoException , written: number , buffer: TBuffer ) => void ) ) : void
Parameters
fd: number
buffer: TBuffer
offset: undefined | null | number
length: undefined | null | number
callback: ( ( err: null | ErrnoException , written: number , buffer: TBuffer ) => void )
( err: null | ErrnoException , written: number , buffer: TBuffer ) : void
Parameters
written: number
buffer: TBuffer
Returns void
Returns void
Defined in node_modules/@types/node/fs.d.ts:2139
write< TBuffer > ( fd: number , buffer: TBuffer , offset: undefined | null | number , callback: ( ( err: null | ErrnoException , written: number , buffer: TBuffer ) => void ) ) : void
Parameters
fd: number
buffer: TBuffer
offset: undefined | null | number
callback: ( ( err: null | ErrnoException , written: number , buffer: TBuffer ) => void )
( err: null | ErrnoException , written: number , buffer: TBuffer ) : void
Parameters
written: number
buffer: TBuffer
Returns void
Returns void
Defined in node_modules/@types/node/fs.d.ts:2151
write< TBuffer > ( fd: number , buffer: TBuffer , callback: ( ( err: null | ErrnoException , written: number , buffer: TBuffer ) => void ) ) : void
Parameters
fd: number
buffer: TBuffer
callback: ( ( err: null | ErrnoException , written: number , buffer: TBuffer ) => void )
( err: null | ErrnoException , written: number , buffer: TBuffer ) : void
Parameters
written: number
buffer: TBuffer
Returns void
Returns void
Defined in node_modules/@types/node/fs.d.ts:2161
write( fd: number , string: string , position: undefined | null | number , encoding: undefined | null | BufferEncoding , callback: ( ( err: null | ErrnoException , written: number , str: string ) => void ) ) : void
Parameters
fd: number
string: string
position: undefined | null | number
encoding: undefined | null | BufferEncoding
callback: ( ( err: null | ErrnoException , written: number , str: string ) => void )
( err: null | ErrnoException , written: number , str: string ) : void
Parameters
written: number
str: string
Returns void
Returns void
Defined in node_modules/@types/node/fs.d.ts:2169
write( fd: number , string: string , position: undefined | null | number , callback: ( ( err: null | ErrnoException , written: number , str: string ) => void ) ) : void
Parameters
fd: number
string: string
position: undefined | null | number
callback: ( ( err: null | ErrnoException , written: number , str: string ) => void )
( err: null | ErrnoException , written: number , str: string ) : void
Parameters
written: number
str: string
Returns void
Returns void
Defined in node_modules/@types/node/fs.d.ts:2182
write( fd: number , string: string , callback: ( ( err: null | ErrnoException , written: number , str: string ) => void ) ) : void
Parameters
fd: number
string: string
callback: ( ( err: null | ErrnoException , written: number , str: string ) => void )
( err: null | ErrnoException , written: number , str: string ) : void
Parameters
written: number
str: string
Returns void
Returns void
Defined in node_modules/@types/node/fs.d.ts:2188
Write
buffer
to the file specified byfd
.offset
determines the part of the buffer to be written, andlength
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. Iftypeof position !== 'number'
, the data will be written at the current position. Seepwrite(2)
.The callback will be given three arguments
(err, bytesWritten, buffer)
wherebytesWritten
specifies how many bytes were written frombuffer
.If this method is invoked as its
util.promisify()
ed version, it returns a promise for anObject
withbytesWritten
andbuffer
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.
Since
v0.0.2