Closed brillout closed 4 years ago
@brillout It seems as if 12.2.0 introduced even more changes under the hood.
@brillout This seems to be what we are experiencing in #198. I already made a fix for that in https://github.com/raszi/node-tmp/tree/matsev-update-dependencies-to-latest-versions. But I still need to figure out on how to push these changes to the original branch in order to get the PR #198 working.
Fixed with #198.
Expected Behavior
When using
setGracefulCleanup()
the file should not exist anymore after the process is terminated.Experienced Behavior
setGracefulCleanup()
works when the process receives a SIGINT but doesn't when the signal is SIGTERM or SIGKILL.Same if the the machine were to unexpectedly crash, e.g. the machine's power is shut down.
On linux, the trick would be to create a file and to delete it right away while still having the file open. (As mentioned here.)
Env
tmp@0.1.0