[openbeos] Re: FS question

  • From: "Alexander G. M. Smith" <agmsmith@xxxxxxxxxx>
  • To: openbeos@xxxxxxxxxxxxx
  • Date: Wed, 16 Jan 2002 10:19:13 -0500

> The problem is to make the StorageKit on other FS than
> BeFS ... FAT.. ReiserFS.. ie, how to solve the problem
> of node_refs and entry_refs
> My problem is : how can I initialize eg.: a BDirectory
> with entry_ref? get_ref_for_path can tranlate from
> filename/path to inode and device number with stat().
> it's easy. But I didn't find any reverse way to make an
> lookup/mapping from dev.inode number to
> path ( or fildescriptor is would be suitable)

That's on purpose.  Unix file systems are single linked,
there's a link in the directory to each file it contains
(a directory is basically a list of names and corresponding
inode numbers to identify the files).  A Unix file doesn't
know who its parents are, it merely has a link counter (and
it self destructs when it goes to zero).  BFS does have a
way of finding out the file name of a file, but I don't think
it stores parent directory information for files (just
directories, like Unix).  So, no find path for file inode call.

On the other hand, my experimental RAM file system does
have parent links, and a file can even be in multiple parent
directories.  I use that to implement hard links (actually,
more like an improved version of Macintosh aliases).  So
perhaps finding parent directories would be a useful optional
thing for the file system API to have.

- Alex


Other related posts: