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. > 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) Oh ok I see what you are saying, sort of like chattr for ext3, only globally. Doesn't sound like a terrible idea to me, but I will defer to the more experienced people on this list. Josef -- 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