Re: NTFS-like streams?

From: James Sutherland (jas88@cam.ac.uk)
Date: Sat Aug 12 2000 - 17:23:08 EST


On Sat, 12 Aug 2000, Alexander Viro wrote:
> On Sat, 12 Aug 2000, Linus Torvalds wrote:
>
> > The UNIX notion of "everything is a file" is a thing of beauty. Plan-9
> > took it further, and I'm a staunch believer in things like /proc etc. I
> > don't think resource forks are anything special.
>
> Unlike Plan 9 we have a userland that Should Not Be Broken(tm). And we
> have this "POSIX-compliant" thing too... Linus, POSIX has a lot of nasty
> words about mixing files and directories. And I'm afraid that saying "no,
> foo is file, it just happens to have children" won't work - that way you
> are going to screw a lot of userland stuff.
>
> Again, the _real_ problem is to give a reasonable semantics to unlink(),
> remove-on-last-close, rename() and rmdir() for these beasts. Give me that
> and I'll do VFS support Real Fast(tm). I propose a cop-out - let mount()
> do the job. Then _all_ problems go away, since dubious operations are
> automatically prohibited. If you have something better in mind - go ahead,
> tell what you want.

How about having each stream show up as a different file, i.e.:

/mnt/ntfs/file
/mnt/ntfs/file:otherstream
/mnt/ntfs/file:streams

The three can each be open()ed, cat'ed, rm'ed etc. like normal files. The
only proviso is that deleting "file" will also remove "file:*", which may
surprise a few utils?

Upside:

Say I install a thumbnail viewer, gnail. This creates "gnail" streams to
each image it processes, leaving me with:

/home/mine/tux.jpg
/home/mine/tux.jpg:gnail
/home/mine/daemon.jpg
/home/mine/daemon.jpg:gnail

If I then get rid of gnail, I can simple "rm -f ~/*:gnail", and the
thumbnails have gone. If I "rm -f ~/tux.jpg", the thumbnail goes too.

If I then want to move daemon.jpg to another directory, I can use mv:
it simply moves all the streams one after the other. Even if I move to an
ext2 partition, it works as expected: the gnail stream becomes a distinct
file. When I move the files back, the stream is reunited.

Seems a pretty logical approach, IMO?

James.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Tue Aug 15 2000 - 21:00:28 EST