From mboxrd@z Thu Jan 1 00:00:00 1970 From: Josef Bacik Subject: Re: interface to ask is a file is hidden Date: Fri, 10 Oct 2008 15:57:46 -0400 Message-ID: <20081010195746.GE19500@unused.rdu.redhat.com> 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 mx2.redhat.com ([66.187.237.31]:52895 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1760421AbYJJUH1 (ORCPT ); Fri, 10 Oct 2008 16:07:27 -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. > So that the GIO code won't look like this >=20 > if (filesystem_is_ext3(fs)) > hidden=3Dext3_get_hidden(file); > else if (filesystem_is_fat16()fs) > hidden=3Dfat16_get_hidden(file); > else if (filesystem_is_fat32(fs)) > hidden=3Dfat32_get_hidden(file); > else if (filesystem_is_ntfs(fs)) > hidden=3Dntfs_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=3DFALSE; > >=20 > 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=3Dget_filesyste_interface(fs)->get_hidden(file) Oh ok I see what you are saying, sort of like chattr for ext3, only glo= bally. 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@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html