mirror of https://github.com/nodejs/node.git
fs: use async writeFile in FileHandle#appendFile
When operating on a FileHandle, the file has already been opened with the flag given as an option to fs.promises.open(). This means defaulting to 'a' has no effect here, and FileHandle#appendFile turns out to exactly be an alias of writeFile. This is now explicit, saving a stack frame, object copy and assignment. PR-URL: https://github.com/nodejs/node/pull/31235 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com>
This commit is contained in:
parent
a566c05a49
commit
73a9c37307
|
@ -70,7 +70,7 @@ class FileHandle {
|
|||
}
|
||||
|
||||
appendFile(data, options) {
|
||||
return appendFile(this, data, options);
|
||||
return writeFile(this, data, options);
|
||||
}
|
||||
|
||||
chmod(mode) {
|
||||
|
|
Loading…
Reference in New Issue