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: James Bucanek <email@hidden>
- Date: Fri, 26 Aug 2005 09:54:04 -0700
Giovanni Donelli wrote on Friday, August 26, 2005:
>Hi Folks,
> I'm trying to remove the hidden files from the content of a
>directory.
>
>1st. I'm first checking if the name start with a dot: "."
>2nd. I'm using the launch services to determine whether the hidden
>flag is on
>
>Still few hidden files are left out from this (such as the mach
>kernel in the disk root)
>
>now... there was suppose to be a file called ".hidden" in the
>directory which would have listed other hidden files... however I
>can't find this file anywhere in Tiger
>
>Anybody any suggestions?
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...
This is the exact same interface the Finder and most other system frameworks use. It applies all of the rules that OS X uses to determine if a file should normally be hidden from the user. And will continue to do so in the future, even if those rules change.
--
James Bucanek
_______________________________________________
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