-
Notifications
You must be signed in to change notification settings - Fork 16
Remove file when process is canceled #1
Comments
Optimally, yes, but cleanup on exit in Node is not really very optimal (because you have no guarantees that anything async will complete before the process shuts down). We could enqueue files into a list and then
VERY YES. The atomicity of the operation depends on |
I guess we could do it manually in our package by removing |
It's tricky, because I've seen exit handlers fail to fire once there are more than a couple |
Maybe someday (hopefully I'm still alive :p): http://nodejs.org/docs/v0.11.13/api/process.html#process_event_beforeexit
Still better than nothing though. |
Yeah, |
Failing to remove temporary files isn't a disaster, it's merely the current behaviour. |
It has been about a year, with a few major versions of Node with |
Currently, if you're doing stuff using
fsWriteStreamAtomic()
and cancels the process the temp file will remain in place. Optimally it'd clean up any temp files on exit.Also, are there any reasons to not write the temp files to
os.tmpdir()
?The text was updated successfully, but these errors were encountered: