tractordev / wanix

Experimental, local-first, web-native, Unix-like development environment
https://wanix.sh
MIT License
206 stars 11 forks source link

fs: temp directory semantics #55

Closed Parzival-3141 closed 5 months ago

Parzival-3141 commented 6 months ago

One thing I find particularly annoying about Windows is that unlike Linux there are no guarantees for when temporary directories are deleted. This leads to drive bloat and shoddy programs which rely on temp-dirs for long term storage, potentially causing issues if you just wipe the whole thing. Blech.

I propose clearing the system temporary directory (i.e. /tmp or /sys/tmp, etc.) at shutdown. This gives programs an easy caching solution while forcing them elsewhere for long term storage, as the user could reset the system at any time.

This could be implemented as a memfs mounted to /tmp, being cleared alongside Wanix when the browser ends the process.

The build tool was written assuming this behavior, although it can be changed if this proposal is rejected.

progrium commented 6 months ago

Great idea, great implementation proposal!