Automatic garbage collection when opening tmp root
I think it should be possible to avoid the pitfall of leaking directories when their destructors fail to run. The idea is to do garbage collection on a directory when opening it. We can avoid interfering with other processes using that directory by acquiring an advisory file lock. As such, the user would need to have a dedicated directory to designate as the tmp root so all users are aware of the opt-in locking.
If this sounds desirable I'd be happy to provide a PR, as I already have this feature implemented in my own crate.
关闭于 2025-09-20 3 条评论