Re: what happend of the .hidden file in Tiger? [MOSTLY SOLVED]
Re: what happend of the .hidden file in Tiger? [MOSTLY SOLVED]
- Subject: Re: what happend of the .hidden file in Tiger? [MOSTLY SOLVED]
- From: Mason Mark <email@hidden>
- Date: Sat, 27 Aug 2005 19:00:42 +0900
On Aug 27, 2005, at 6:16 PM, Finlay Dobbie wrote:
On 27/08/05, James Bucanek <email@hidden> wrote:
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?
I wouldn't be surprised if the problem was that it's resolving the
symlinks at /tmp, /var, /etc and so on to their corresponding
directories in /private, and then examining the target's HFS
attributes...
The only errors you're getting are because you can't get FSRefs to
/.vol and /dev. If you use URLs rather than FSRefs then LS will
correctly report them as invisible.
OK, I couldn't resist testing this before going home, since this
issue had bugged me since way back.
You're right: the problem with /etc, etc. (ahem) was that my little
test code snippet was broken, in that I used FSPathMakeRef to get the
FSRef. Changing it to ask Launch Services by URL, as shown below,
worked in *almost* all cases.
The only 2 files that have a discrepancy with the Finder is "mach"
and "mach.sym".
So, for the most part, the ".hidden" kludge really is fixed. (Hooray!)
Cheers,
--
Mason Mark
Five Speed Software, Inc.
-----------------
- (void)test6:(id)sender;
{
NSMutableArray *invisibleItems = [NSMutableArray array];
NSMutableArray *visibleItems = [NSMutableArray array];
NSArray *contents = [[NSFileManager defaultManager]
directoryContentsAtPath:@"/"];
NSEnumerator *e = [contents objectEnumerator];
NSString *path = nil;
OSStatus err = -1;
while (path = [e nextObject]) {
LSItemInfoRecord itemInfo;
NSURL *itemURL = [NSURL URLWithString:[@"file:///"
stringByAppendingString:path]];
err = LSCopyItemInfoForURL((CFURLRef)
itemURL,kLSRequestAllInfo,&itemInfo);
if (err != noErr)
NSLog(@"Got an error for %@, skipping...", path);
else if ((itemInfo.flags&kLSItemInfoIsInvisible) != 0)
[invisibleItems addObject:path];
else
[visibleItems addObject:path];
}
NSLog(@"VISIBLE ITEMS: %@", visibleItems);
NSLog(@"INVISIBLE ITEMS: %@", invisibleItems);
}
_______________________________________________
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