From mboxrd@z Thu Jan 1 00:00:00 1970 From: Theodore Tso Subject: Re: interface to ask is a file is hidden Date: Fri, 10 Oct 2008 17:57:22 -0400 Message-ID: <20081010215722.GG8645@mit.edu> References: <641322f90810101222p3ff36ac3va9057b9958d2abf2@mail.gmail.com> <20081010192104.GD19500@unused.rdu.redhat.com> <20081010193503.GE23734@samba1> <641322f90810101300v3ab5fc15hb20fca0374ebe4b4@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: Jeremy Allison , Alexander Larsson , Szabolcs Szakacsits , Josef Bacik , linux-fsdevel@vger.kernel.org To: =?iso-8859-1?Q?Nicol=F2?= Chieffo <84yelo3@gmail.com> Return-path: Received: from www.church-of-our-saviour.org ([69.25.196.31]:55319 "EHLO thunker.thunk.org" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1760235AbYJJV5r (ORCPT ); Fri, 10 Oct 2008 17:57:47 -0400 Content-Disposition: inline In-Reply-To: <641322f90810101300v3ab5fc15hb20fca0374ebe4b4@mail.gmail.com> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Fri, Oct 10, 2008 at 10:00:28PM +0200, Nicol=F2 Chieffo wrote: > On Fri, Oct 10, 2008 at 03:21:04PM -0400, Josef Bacik wrote: >=20 > > What files are determined as "hidden" is completely up to the appli= cation, 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 cu= ll which > > entries it doesn't want. Having the fs/vfs arbitrarily decide whic= h files are > > "hidden" and shouldn't be returned via readdir is not the correct w= ay to tackle > > this problem, it should be decided via the application. >=20 > Ok, maybe I was not clear in my request >=20 > 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 >=20 > if (filesystem_is_ext3(fs)) > hidden=3Dext3_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@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html