File User Polymorphism

Body: 

File systems could benefit by adding functionality which would allow files to behave differently based upon which user is currently reading them. Objects could have different contents, permissions and attributes.

Details

A file/user polymorphic file system would give file system objects the ability to behave differently, or effectively be different, for each user. It would allow all file information to be selected dynamically based upon entirely upon the current user. In more general terms, a file which is polymorphic could appear completely different, in terms of data content and meta-data, when viewed by different users. The only detail necessarily the same would be the file path.

A short, and incomplete, list of file information that could possibly be managed via this process is,

  • Contents, i.e. The actual file data
  • Attributes
  • Permissions

Foreseen difficulties mainly lie in the area of administration. It is difficult to determine how an administrator would be able to modify a given user's files if it was polymorphic. This could affect operations such as backups negatively. Also, depending on the specific implementation, it has been suggested that there could be difficulties in allowing multiple users access to the file system.

A possible implementation that has been suggested is to implement polymorphic symlinks whose target changes depending on the current user. This would fit nicely with existing file system methodologies and hence be one of the most transparent implementations.

Primarily the benefits of polymorphic file systems lie in the reduction of complexity from the user and application's perspective. They no longer need to take into account whether the system is multi-user or which user is logged in. There is a single file hierarchy for all cases which, without application or user intervention, changes to suit the scenario. However care must be taken to not hard code too many paths. Functions such as find_directory (located in the storage kit) should still be used to find specific directories for application usage as much as possible.

Direct uses are many and varied. The most popular of which is the ability to have the user's home directory managed via a polymorphic entry. This would also simplify the implementation of quick user switching similar to XP and Panther. Also, application settings files could be stored with the application itself, simplifying the copying of the entirety of a given application and its environment.

Resources