Re: interface to ask is a file is hidden

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Oct 10, 2008 at 10:00:28PM +0200, Nicolò Chieffo wrote:
> On Fri, Oct 10, 2008 at 03:21:04PM -0400, Josef Bacik wrote:
> 
> > What files are determined as "hidden" is completely up to the application, and
> > not the filesystem.  Every linux filesystem is going to return all entries in a
> > directory when you do a readdir, and then it is up to the app to cull which
> > entries it doesn't want.  Having the fs/vfs arbitrarily decide which files are
> > "hidden" and shouldn't be returned via readdir is not the correct way to tackle
> > this problem, it should be decided via the application.
> 
> Ok, maybe I was not clear in my request
> 
> As if it's a way to get the size of a file, and this way is common to
> all filesystem (tell me if I'm wrong), we request a common way to ask
> if the file is hidden.

You realie that except for filesystems that are legacy compatible with
Microsoft, the concept of "hidden file" simply doesn't exist?  So when
you say:

> So that the GIO code won't look like this
> 
> if (filesystem_is_ext3(fs))
>     hidden=ext3_get_hidden(file);

Ext3 has no concept of "hidden file".  Niether does ext2, ext4, jfs,
xfs, reseirfs, ufs, etc.

The only ones that would have that concept is vfat (which supports
fat16/fat32), ntfs, nfsv4 and cifs/smbfs.  Even a filesystem which
normally has very bad taste, MacOS's HFS, doesn't support the hidden
attribute.

> If there is a common interface to do this we will gain 2 things
> 1) all filesystem must implement a way to get the hidden attribute

"Must?"  Bzzzt!  There will be many filesystems that have no place to
store a hidden attribute, where the concept doesn't exist.  For
example, NFSv3 simply doesn't possess anything vaguely like a hidden
attribute.  And even if we made a non-standard extension to NFSv3, it
wouldn't be supported by the millions and millions of non-Linux NFSv3
implementations.

The best you might be able to get is an interface that allows an
application to get or set the hidden attribute if is supported --- but
the application must be willing to accept a permission denied error
(some filesystems may only permit people with certain access right or
on some ACL to set the attribute), or a "operation not supported"
failure, for those filesystems that simply have not concept of "hidden
file".

It also means that if a desktop toolkit wants to depend on all
filesystems supporting the concept of hidden files, that's probably a
really bad idea, since it simply doesn't match with reality.

       	   	       	  	 	       - Ted
--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux