New filesystem type: weaker links or reference links

Fairly recently, the concept of ‘weak links’ have become mainstream in programming languages. Even python has them with the weakref system.

Recently, after thinking about a problem, this got me thinking about filesystems. On the Mac (OS X), software is installed by just dragging the Application into an ‘Applications’ directory. Occasionaly, though, you need to have a reference to the application from other directories for various reasons. For example, you may have an InputManager or Plugin or some similar thing. To register these systems, you must create an entry in a directory. This entry can be a real file OR a symbolic link to a real file. Lets assume that you use a symbolic link. This would allow you to remove the application by dragging the application to the trash. This is a good thing for a Macintosh app.

The problem with the above scenario is that you would be left with those dead symbolic links. That is where I got to thinking about some other structure. What if there was some structure in an inode that kept track of these links? You could have the benefits of symbolic links with the consistency of hard links. You could have options on whether the links are valid when the Application is moved or not. The tricky part here is that the filesystem would have to notice who links to an inode or when a link is destroyed.

Here is how it would work. You or the application creates a weaker link in the InputManagers directory to some directory (bundle) in the Applications real directory. Everything works. Now, when the user drags the Application somewhere, the hard link the the Application is changed. This causes a chain of events for the filesystem. It will go though any of the weaker links and remove the entries if that is desired. Now, the filesystem is rid of any dead links.

I haven’t worked out all of the details, but I think this would be an interesting and useful addition to Unix filesystems.

This entry was posted in General. Bookmark the permalink.

Leave a Reply

Your email address will not be published.