filehandle.writev(buffers[, position])
- '缓冲区' <Buffer[]> | <TypedArray[]> | <DataView[]>
position<integer> | <null> 数据应从文件开头的偏移量开始写入buffers。如果position不是number,数据将写入当前位置。默认值:null- 返回:<Promise>
将 <ArrayBufferView> 数组写入文件。
【Write an array of <ArrayBufferView>s to the file.】
这个 promise 是通过一个包含两个属性的对象来实现的:
【The promise is fulfilled with an object containing a two properties:】
bytesWritten<integer> 写入的字节数- '缓冲区' <Buffer[]> | <TypedArray[]> | <DataView[]> 对“缓冲区”输入的引用。
在同一个文件上多次调用 writev() 而不等待 Promise 被完成(或拒绝)是不安全的。
【It is unsafe to call writev() multiple times on the same file without waiting
for the promise to be fulfilled (or rejected).】
在 Linux 上,当文件以追加模式打开时,位置写入不起作用。内核会忽略位置参数,并始终将数据追加到文件末尾。
【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.】