Original Post
This is something I was thinking about earlier, which I don''t think I''ve seen in any operating system or filesystem. I''ve seen OS-design discussion in here before, so...
It will often happen that multiple applications will use the same file - a DLL, an ini file, whatever. So when uninstalling, an app has to assume that the file is still in use - the result is potentially a bunch of files that aren''t being used by anything, but nobody is really sure.
So how about reference-counting files? It would be a feature of the filesystem; each file would have a list of ''application IDs'' (probably UUIDs) for the apps that use it. You instantly get two big features - you can see which app a file belongs to (because many files will only have one app listed), and you can ensure that a file doesn''t get deleted while other apps use it.
It would, of course, require very strict policies on install/uninstall methods; an app which fails to remove itself from the list of referencers would result in a file that can''t be deleted.
Here''s a radical suggestion - force every file that is created to be created with at least one referencer id. A few special IDs would be around for marking a user''s documents or other files which should be freely deletable, but on the whole every file would have at least one app id marking it. When the app is uninstalled, all files marked with the app id could be *automatically* dereferenced; and then, any files with no references could be deleted.
Just some ideas. What would this break? What are the disadvantages (besides the storage space for the IDs)?
Superpig
- saving pigs from untimely fates, and when he''s not doing that, runs The Binary Refinery.
