Trash Spec Idea
backup95 at netcabo.pt
Thu Aug 14 19:59:23 PDT 2008
Andrea Francia wrote:
> There are a lot of filesystems out there and it seems futile to
> keep track of every single one. One possibility is writing a
> parser in C
> that compares the filesystems in /proc/filesystems (I assume "nodev"
> means it's a virtual filesystem?) against /etc/mtab and returns the
> mount points that have the correct type.
> Are you sure that all filesystems with nodev are fake filesystems?
Pretty sure... Again, there are probably weird exceptions out there. I
don't know about FUSE though. Is it relevant for trash purposes? I
really don't know... I see that gvfs-fuse-daemon uses the type
"fuse.gvfs-fuse-daemon" in /etc/mtab and that doesn't match any entry in
> If you rely on /proc/filesystems your program will work only on those
> system that have the /proc filesystem available.
But it should still work on all Unix-like systems. It's not so different
than depending on /etc/mtab.
> I think that the blacklist alternative is better.
> At the present trash-cli doesn't have yet a black-list, simply checks
> if the .Trash directory exists. This works for me.
> If you don't have a /net fileststem the blacklist will only speed up
> the list-trash operation of few milliseconds, I'll implement that only
> after other things.
I have to disagree there. You're hard coding something that can be
provided dynamically by the kernel. I wrote some basic proof of concept
type code and it seems to work well. It prints to stdout all the mount
points associated with device nodes. Even as a command line tool maybe
it could fill a legitimate need if improved. I'm attaching it in case
anyone is interested, I hope that's OK.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 3282 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/xdg/attachments/20080815/d51d457b/attachment.c
More information about the xdg