-
Notifications
You must be signed in to change notification settings - Fork 29.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fs.writeFile doesn't work with non-seekable files #31926
Comments
👍 I think fixing this might be as straightforward as switching the The only thing that I could see being tricky about this is that this changes behaviour when an |
Oh true, I didn't remember that fds are accepted... yes, for fds it would change behaviour, but at the same time it's a bug people would likely not rely on, and it's inconsistent with if we don't want to change behaviour, I suppose we can fix it only for paths like you said, and then a semver-major full fix? |
@mildsunrise Yeah, that’s … not great. I’m not sure what to do about that, besides what you suggested above – first only fix this for paths, then make behaviour consistent in a semver-major change. |
Completely disables the use of positioned writes at writeFile and writeFileSync, which allows it to work with non-seekable files. Fixes: nodejs#31926 PR-URL: nodejs#32006 Reviewed-By: Anna Henningsen <anna@addaleax.net>
Completely disables the use of positioned writes at writeFile and writeFileSync, which allows it to work with non-seekable files. Fixes: nodejs/node#31926
I see that
fs.writeFile*
fails with non-seekable files, because it does a positioned write:fs.readFile
works correctly since it does a regularread
, and I also found thatcreateWriteStream
was fixed to work with non-seekable files (#19329).Is this known/intentional? If not, would a fix be accepted? (I haven't investigated further yet)
The text was updated successfully, but these errors were encountered: