From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alexander Larsson Subject: Re: interface to ask is a file is hidden Date: Mon, 13 Oct 2008 10:22:53 +0200 Message-ID: <1223886173.22225.159.camel@fatty> References: <641322f90810101222p3ff36ac3va9057b9958d2abf2@mail.gmail.com> <20081010192104.GD19500@unused.rdu.redhat.com> <20081010193503.GE23734@samba1> <641322f90810101300v3ab5fc15hb20fca0374ebe4b4@mail.gmail.com> <20081010215722.GG8645@mit.edu> <20081010220156.GA25396@infradead.org> Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit Cc: Theodore Tso , Nicol? Chieffo <84yelo3@gmail.com>, Jeremy Allison , Szabolcs Szakacsits , Josef Bacik , linux-fsdevel@vger.kernel.org To: Christoph Hellwig Return-path: Received: from mx2.redhat.com ([66.187.237.31]:49975 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755627AbYJMIXb (ORCPT ); Mon, 13 Oct 2008 04:23:31 -0400 In-Reply-To: <20081010220156.GA25396@infradead.org> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Fri, 2008-10-10 at 18:01 -0400, Christoph Hellwig wrote: > On Fri, Oct 10, 2008 at 05:57:22PM -0400, Theodore Tso wrote: > > 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". > > Yes. he best thing you could do is to add support for the > FAT_IOCTL_GET_ATTRIBUTES/FAT_IOCTL_SET_ATTRIBUTES ioctls to other > windows-heritage filesystems. Feel free to submit patches. This is a bad interface for most apps. You need to open each file to get a fd to pass to ioctl. This is problematic if for instance you don't have read access to the file. So, you really want a path-based operation for this. Its also very expensive since it causes lots of extra I/O. For instance, a file manager that wants to hide files with the hidden attribute set (on filesystems which support this) would have to open all files just so it could try calling this ioctl. To avoid this you can do some filesystem matching and hard code the lists of filesystems that supports this call, but having a clean API would be nicer and more efficient. Now, you could argue (and unsurpisingly you do) that ext3 & co doesn't have a hidden attribute, but that doesn't mean I can ignore actual users who have data on other filesystems and want to integrate nicely with them. This includes not showing weird system files that are normally hidden on said filesystems.