This commit is contained in:
@@ -14,8 +14,9 @@ export default class NodeFileSystemWritableFileStream extends WritableStream imp
|
||||
constructor(name: string, options: FileSystemCreateWritableOptions = {}) {
|
||||
name = path.normalize(name)
|
||||
let flags = 'w'
|
||||
if (!options.keepExistingData) flags = 'r+'
|
||||
if (options.keepExistingData) flags = 'r+'
|
||||
const fd = fs.openSync(name, flags)
|
||||
if (!options.keepExistingData) fs.ftruncateSync(fd, 0)
|
||||
super(Writable.toWeb(fs.createWriteStream(name, { "fd": fd })))
|
||||
this.#fd = fd
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user