Node.js fs filehandle.read
Node.js fs filehandle.read(buffer, offset, length, position)
- buffer < Buffer> |
- offset < integer>
- length < integer>
- position < integer>
Read data from the file.
buffer is the buffer that the data will be written to.
offset is the offset in the buffer to start writing at.
length is an integer specifying the number of bytes to read.
position is an argument specifying where to begin reading from in the file. If position is null, 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 remain unchanged.
Following successful read, the Promise is resolved with an object with a bytesRead property specifying the number of bytes read, and a buffer property that is a reference to the passed in buffer argument.
更多内容请参考：Node.js fs 文件系统，或者通过 点击对应菜单 进行查看；