sunxfancy / whefs

Automatically exported from code.google.com/p/whefs
Other
0 stars 0 forks source link

whefs "should" support directories #3

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
The current EFS layout has a flat namespace. That is, there are no
directories. That said, you may name a file "/foo/bar.txt" if you wish, as
long as its name isn't longer than the built-in VFS limit.

The inode internals have some bits in place for handling directories, but
it's not yet implemented. This needs several parts:

1) We need to settle on a path separator or make it configurable.

2) We need path parsing code, and such parsing will almost certainly
require more malloc() calls than i really want to be making (but probably
can't avoid). That also means making sure parse results get cleaned up
properly.

3) fopen() and friends need to parse the paths (or have them parsed).

4) unlink() and friends would need to unlink child inodes and disconnect
the inode from its parent inode.

5) we might also end up needing (or wanting) a concept of "current virtual
working directory", to simplify some fopen() uses.

stephan added on 2009-01-10 03:19:42:

The more i think about this, the more i like the idea of not having
directories. Yeah, it'd be a nice feature, but so is the ability to name
files "/path/to/file" without having to actually worry about whether the
dirs "/path/to/" exist. Where this becomes a problem is searching for files
by name (or name patterns) on big filesystems (hundreds+ of files), since
we have to search the whole global namespace/dir for them. That'll get
ssllooww.

i'm currently leaning towards not supporting subdirs, out of simplicity. If
the need for them becomes great, or an elegant solution to implementing
them presents itself, i'll take another look at the idea.

Original issue reported on code.google.com by sgbeal@googlemail.com on 17 Jun 2009 at 12:37

GoogleCodeExporter commented 8 years ago

Original comment by sgbeal@googlemail.com on 26 Jun 2009 at 9:09

GoogleCodeExporter commented 8 years ago

Original comment by sgbeal@googlemail.com on 5 Jul 2009 at 1:31

GoogleCodeExporter commented 8 years ago
i've changed my mind on this. Directories == too much complexity. The ability 
to "attach" multiples EFSes would be cool, and implies having namespaces (i.e. 
directories) to attach them to, but it won't happen unless i just happen to get 
a lot of extra time and energy.

Original comment by sgbeal@googlemail.com on 24 Oct 2011 at 10:47