-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
mktemp/dir: delete temp files on exit by default
The main change here is that the non-higher-order versions of mktemp/dir will now by default put the temp files/dirs that they create into a temp cleanup list which will be deleted upon process exit. Instead of putting lots of atexit handlers in the list, this uses a single handler and keeps a list of temporary paths to cleanup. If the list gets long (> 1024) it will be scanned for already-deleted paths when adding a new path to the cleanup list. To avoid running too frequently, it doubles the "too many paths" threshold after this. If cleanup fails for higher order `mktemp() do ... end` forms, they will also put their temp files/dirs in the cleanup list but marked for "asap" deletion. Every time the above mechanism for cleaning out the temp cleanup list scans for already-deleted temp files, this will try again to delete these temp files.
- Loading branch information
1 parent
4537d78
commit 39495b7
Showing
5 changed files
with
244 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters