Jump to headingread<TBuffer extends ArrayBufferView>(fd: number,buffer: TBuffer,offset: number,length: number,position: ReadPosition | null,callback: (err: ErrnoException | null,bytesRead: number,buffer: TBuffer,) => void,): voidRead data from the file specified by fd.
The callback is given the three arguments, (err, bytesRead, buffer).
If the file is not modified concurrently, the end-of-file is reached when the number of bytes read is zero.
If this method is invoked as its util.promisify() ed version, it returns
a promise for an Object with bytesRead and buffer properties.
Type Parameters Jump to heading
Jump to headingTBuffer extends ArrayBufferViewParameters Jump to heading
Jump to headingfd: numberJump to headingbuffer: TBufferThe buffer that the data will be written to.
Jump to headingoffset: numberThe position in buffer to write the data to.
Jump to headinglength: numberThe number of bytes to read.
Jump to headingposition: ReadPosition | nullSpecifies where to begin reading from in the file. If position is null or -1 , data will be read from the current file position, and the file position will be updated. If
position is an integer, the file position will be unchanged.
Jump to headingcallback: () => voidReturn Type Jump to heading
voidJump to headingread<TBuffer extends ArrayBufferView>(fd: number,options: ReadAsyncOptions<TBuffer>,callback: (err: ErrnoException | null,bytesRead: number,buffer: TBuffer,) => void,): voidSimilar to the above fs.read function, this version takes an optional options object.
If not otherwise specified in an options object,
buffer defaults to Buffer.alloc(16384),
offset defaults to 0,
length defaults to buffer.byteLength, - offset as of Node 17.6.0
position defaults to null
Type Parameters Jump to heading
Jump to headingTBuffer extends ArrayBufferViewParameters Jump to heading
Jump to headingfd: numberJump to headingoptions: ReadAsyncOptions<TBuffer>Jump to headingcallback: () => voidReturn Type Jump to heading
voidJump to headingread(fd: number,callback: (err: ErrnoException | null,bytesRead: number,buffer: ArrayBufferView,) => void,): voidParameters Jump to heading
Jump to headingfd: numberJump to headingcallback: (err: ErrnoException | null,bytesRead: number,buffer: ArrayBufferView,) => voidReturn Type Jump to heading
void