From owner-freebsd-fs@FreeBSD.ORG Thu Mar 2 08:00:36 2006 Return-Path: X-Original-To: freebsd-fs@freebsd.org Delivered-To: freebsd-fs@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4C7D816A420 for ; Thu, 2 Mar 2006 08:00:36 +0000 (GMT) (envelope-from conrad@mac.com) Received: from smtpout.mac.com (smtpout.mac.com [17.250.248.46]) by mx1.FreeBSD.org (Postfix) with ESMTP id EBE6943D45 for ; Thu, 2 Mar 2006 08:00:35 +0000 (GMT) (envelope-from conrad@mac.com) Received: from mac.com (smtpin03-en2 [10.13.10.148]) by smtpout.mac.com (Xserve/8.12.11/smtpout10/MantshX 4.0) with ESMTP id k2280Z51016014; Thu, 2 Mar 2006 00:00:35 -0800 (PST) Received: from [10.0.1.3] (ppp-71-139-59-11.dsl.snfc21.pacbell.net [71.139.59.11]) (authenticated bits=0) by mac.com (Xserve/smtpin03/MantshX 4.0) with ESMTP id k2280XOW025170; Thu, 2 Mar 2006 00:00:34 -0800 (PST) Mime-Version: 1.0 Message-Id: In-Reply-To: References: Date: Wed, 1 Mar 2006 23:59:59 -0800 To: Mark Day From: conrad@mac.com Content-Type: text/plain; charset="us-ascii" ; format="flowed" Cc: freebsd-fs@freebsd.org Subject: Re: Add a file flag for "hidden" files? X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Mar 2006 08:00:36 -0000 At 9:48 AM -0800 3/1/06, Mark Day wrote: >For an future version of Mac OS X, I'm trying to solve a problem >where certain files and directories on Windows file systems don't >normally appear in the Windows GUI, but currently do appear in the >Mac OS X GUI (but they shouldn't). I'd like to gauge interest in >having the change ported back to FreeBSD (since many of our file >systems are derived from FreeBSD). The approach I'm planning to use >is to add a new flag to the file flags (i.e. the st_flags field from >stat(2); settable via chflags(2)). I'd like to avoid a collision >with any flags FreeBSD would add in the future, so either have >FreeBSD adopt the flag, or start allocating Mac OS X-specific flags >from the high order bits (since FreeBSD has been allocating them >from the low order bits). My current name for this new file flag is >UF_HIDDEN. > >Windows file systems (FAT, NTFS, SMB) have a "hidden" attribute bit >on files and directories. If a file or directory has this attribute >set, Windows will not normally show it in the GUI unless you >explicit ask to view hidden items. Mac file systems (HFS, AFP) have >a similar notion called the "invisible" bit, which is just one part >of the Finder Info (which also contains things like file type and >creator information, icon position, etc.). > >Mac OS X has a mechanism for storing Finder Info on file systems >without native support for Finder Info, by using extra files known >as AppleDouble or "dot underscore" files (because their name is the >original file's name with "._" prepended). The management of the >AppleDouble files happens in application-layer libraries in Mac OS X >10.3.x and earlier, and also in the VFS layer in Mac OS X 10.4.x and >later. It would be complex to try to push the AppleDouble support >down into the Windows file systems merely so they could shadow their >native hidden bit into the invisible bit of the Finder Info. The >file flags are very easy for individual file systems to implement. Hey Mark This is great with MS' SMB servers, and also with local filesystems, as they can easily have UF_HIDDEN added. What are you thinking for other filesystems, for remotely served filesystems, that is, which for whatever reason don't read/write UF_HIDDEN? Conrad Minshall