类:FileHandle
¥Class: FileHandle
<FileHandle> 对象是数字文件描述符的对象封装。
¥A <FileHandle> object is an object wrapper for a numeric file descriptor.
<FileHandle> 对象的实例通过 fsPromises.open()
方法创建。
¥Instances of the <FileHandle> object are created by the fsPromises.open()
method.
所有 <FileHandle> 对象都是 <EventEmitter>。
¥All <FileHandle> objects are <EventEmitter>.
如果未使用 filehandle.close()
方法关闭 <FileHandle>,则它将尝试自动关闭文件描述符并触发进程警告,从而有助于防止内存泄漏。请不要依赖此行为,因为它可能不可靠并且该文件可能未被关闭。相反,始终显式关闭 <FileHandle>。Node.js 将来可能会更改此行为。
¥If a <FileHandle> is not closed using the filehandle.close()
method, it will
try to automatically close the file descriptor and emit a process warning,
helping to prevent memory leaks. Please do not rely on this behavior because
it can be unreliable and the file may not be closed. Instead, always explicitly
close <FileHandle>. Node.js may change this behavior in the future.