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 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.
So that the GIO code won't look like this

if (filesystem_is_ext3(fs))
    hidden=ext3_get_hidden(file);
else if (filesystem_is_fat16()fs)
    hidden=fat16_get_hidden(file);
else if (filesystem_is_fat32(fs))
    hidden=fat32_get_hidden(file);
else if (filesystem_is_ntfs(fs))
    hidden=ntfs_get_hidden(file);
else if (filesystem_is_new_filesystem_just_invented(fs)
    /* oops! no way to get if a file is hidden because the maintainer
didn't implement it */
    hidden=FALSE;


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
3) the application VFS must not know every filesystem type to support
hidden files
2) much simpler code in application VFS, that might look like this:
    hidden=get_filesyste_interface(fs)->get_hidden(file)
--
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