Create FileHandle from fd in Node.js

Viewed 86

If I have opened file by const fd = fs.openSync(...) is it possible to get a FileHandle object from fd somehow and continue by await fileHandle.writev(...)? I have some existing code using FileHandle but need to do sync file open.

Note: I know I can util.promisify(fs) and use await fs.writev(fd, ...), but I would need to rewrite the old code, then.

0 Answers
Related