Re: what happend of the .hidden file in Tiger?
Re: what happend of the .hidden file in Tiger?
- Subject: Re: what happend of the .hidden file in Tiger?
- From: Mason Mark <email@hidden>
- Date: Sat, 27 Aug 2005 18:34:00 +0900
On Aug 27, 2005, at 2:25 PM, James Bucanek wrote:
Mason Mark wrote on Saturday, August 27, 2005:
On Aug 27, 2005, at 1:54 AM, James Bucanek wrote:
Stop trying to second guess the OS and just ask Launch Services if
the item is hidden or not:
LSItemInfoRecord itemInfo;
err = LSCopyItemInfoForRef
(&itemRef,kLSRequestBasicFlagsOnly,&itemInfo);
if ( (itemInfo.flags&kLSItemInfoIsInvisible) != 0 )
{
// item is invisible...
[snip]
My quibble with the above statement is that Launch Services couldn't
really "continue to work" unless it worked now, which it doesn't.
While it does seem to work somewhat *better* than in pre-10.4 OS
versions... it still misses some files which should be
presented the user as invisible
[snip snip]
This is news to me. I've never had any problem with LS until I ran
your test code. Admittedly, I haven't really tested any of my code
since Tiger, so maybe it's a 10.4 issue. Have you filed a bug report?
James
I believe I filed a radar bug on this issue 2 or 3 years ago.
AFAIK this has been broken in every version of Mac OS X to date. It's
nice to see that it is getting better, but not so nice that Apple
took away the .hidden file without actually fixing the behavior.
It causes the shipping version of our Mac file transfer app to show
files it shouldn't when running under 10.4, since our app shipped on
10.3 and so uses the kludgey .hidden file. Granted, that was not a
supported nor documented API. But it seemed like the thing to do,
because the only other option was to hardcode the names of those
files which were not invisible by any normal mechanism, but
nevertheless were hidden by the Finder.
In retrospect, we should have just hardcoded them though. In fact,
that's what I still had to do for the upcoming 2.0 version of our app
(iGet). The code snippet is below.
One reason you might not have noticed this issue: since Launch
Services now knows that ".whatever" files are invisible, I *think*
this problem is confined to the root of the disk. That is, the Launch
Services API seems to correctly tell you whether or a not a file is
invisible as long as it is not located inside the root directory.
Or, to put it another way, the Finder does not seem to hide files
which are not actually invisible, except in the root directory.
Cheers,
--
Mason Mark
Five Speed Software, Inc.
http://www.fivespeed.com
------------------------
//Mason April 2005: In former times, Mac OS X used a file called
//.hidden as yet another mechanism to hide files. This changed in
//10.4; the file no longer exists. So, I am hardcoding the
//filenames which were contained in that file on 10.3 (as the new
//mechanism for determining invisiblity of items in the root of a
//disk is unknown AOTW). What a kludge.
/*! The filenames of items which should be hidden in the root
directory (/) when
the user has not chosen to Show Invisible Files. */
+ (NSArray *)hiddenFiles;
{
static NSArray *sharedHiddenFilesInstance = nil;
if (! sharedHiddenFilesInstance)
sharedHiddenFilesInstance = [[NSArray alloc] initWithObjects:
@"automount",
@"bin",
@"cores",
@"Desktop DB",
@"Desktop DF",
@"Desktop Folder",
@"dev",
@"etc",
@"lost+found",
@"mach",
@"mach_kernel",
@"mach.sym",
@"opt",
@"private",
@"sbin",
@"tmp",
@"Trash",
@"usr",
@"var",
@"VM Storage",
@"Volumes",
nil];
return sharedHiddenFilesInstance;
}
----------------------------
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden