Re: Filesystem View
Re: Filesystem View
- Subject: Re: Filesystem View
- From: Hamish Allan <email@hidden>
- Date: Sat, 21 May 2005 16:46:33 +0100
Ingvar,
I certainly will. I will probably be seeking a lot of advice on this
list, as I have never really tried anything like filesystem
programming before. I'd like to make this an open-source project --
If anyone else (experienced or otherwise) is interested in helping to
make this happen, please get in touch.
Best wishes,
Hamish
On 21 May 2005, at 11:15, Ingvar Nedrebo wrote:
Hamish,
I have a very similar project in mind, but wont get around to it
for another couple of months, so it would be great if you could
share with the list which approach you end up taking.
i.
On May 20, 2005, at 12:35, Hamish Allan wrote:
Mike,
You raise very pertinent issues. Thank you for taking an interest.
One thing that you want to consider here is whether you want
queries to map to files or directories. I would be inclined to
go with the latter, myself, since many queries will yield more
than one result (imagine you had two files called 'test.txt' in
the above case).
You're right. I think what I want is this sort of thing:
$ find /Users/hamish/test -type f
/Users/hamish/test/test1/test1.txt
/Users/hamish/test/test1/test2.txt
/Users/hamish/test/test2/test1.txt
/Users/hamish/test/test2/test2.txt
$ find /Users/hamish/test -type f -name test1.txt | xargs ls -i
1232001 /Users/hamish/test/test1/test1.txt
1231998 /Users/hamish/test/test2/test1.txt
$ find /.slfs/kMDItemFSName==\'test1.txt\' -type f | xargs ls -i
1232001 /.slfs/Users/hamish/test/test1/test1.txt
1231998 /.slfs/Users/hamish/test/test2/test1.txt
How you chose to back the filesystem is really up to you; one
approach would simply be to populate the 'cache' directories with
symbolic links to the actual files/folders. Another would be to
redirect lookups across to the real filesystem. A third (more
like WebDAVfs) would be to have the fsnode hold a reference to
the 'real' vnode.
I'm afraid I don't know enough about filesystems yet to know what
the differences between inodes, vnodes and fsnodes are (I've only
ever really been an applications programmer up until now) -- and
Googling for all three at once didn't turn up any explanation. I
will go and dig some more, and also look at the WevDAVfs code. I
think what I have described above is more like your second option
though? Is that what volfs is doing, do you know?
The drawback with the WebDAVfs approach in your case is that
modifications to a file might have the effect of moving it out of
the 'directory' (because it no longer matches the query), and so
the 'path' to the file might change in ways that an application
would not be happy about.
Yes. Would this problem be circumvented by the above approach?
A problem with the symlink approach would be that it would not be
possible to have those files be the 'real' files, so you couldn't
e.g. delete them, or move them en masse. This isn't so much a
problem because you can get this sort of behaviour with the
Finder search box already.
I think that none of the folders would be writable, but you could
modify the files themselves (seemingly "in place") if you had
appropriate permissions, as is the case with volfs.
It's an interesting problem; have fun with it!
Thanks!
Hamish
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden