home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.misc      General topics about computers not cover      21,759 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 21,418 of 21,759   
   Lawrence =?iso-8859-13?q?D=FFOlivei to All   
   File/Directory Unification   
   14 Sep 25 07:07:29   
   
   From: ldo@nz.invalid   
      
   I recall an interview with Hans Reiser many years ago (before he was done   
   for murdering his wife, obviously), when he was still working on the   
   Reiser4 filesystem, the intended successor to ReiserFS, where he mentioned   
   one of its notable features (besides tail-packing -- notable to me,   
   anyway!) was that every file was also a directory, and every directory was   
   a file.   
      
   To put it another way, each item in the filesystem has a “data fork” and a   
   “directory fork”; if you open it as a file, you can read and write the   
   data fork. If you open it as a directory, then you can access and   
   manipulate the set of child items referenced in the directory fork, which   
   in turn are themselves both files and directories.   
      
   Either fork can be empty, of course. So to represent a conventional POSIX   
   directory, you leave the data fork empty; and to represent a conventional   
   POSIX file, you leave the directory fork empty.   
      
   This sounded like a neat idea. But, thinking about it, I realized recently   
   it can’t really work on POSIX systems. (Or maybe it can ... see below.)   
      
   The problem is that POSIX allows multiple hard links to a file, but not to   
   a directory. There are good reasons for this. So if every file can also be   
   a directory, then you must either forbid multiple-linking for *all*   
   filesystem items, or rescind the rule against it, with consequent   
   unpleasant ramifications for the integrity of your filesystem.   
      
   Alternatively, you could keep the rule, and just forbid creating a second   
   hard link to an item with a nonempty directory fork; and conversely,   
   forbid creating a nonempty directory fork on an item which is already   
   hard-linked into more than one parent directory.   
      
   That would be a way to make it work.   
      
   You still have the ambiguity that a newly-created item has both an empty   
   data fork and empty directory fork, so it has the potential to turn into   
   either a POSIX-type file or a POSIX-type directory, depending on which   
   fork has stuff added to it first ...   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca