Re: How can know a file is hidden?
Re: How can know a file is hidden?
- Subject: Re: How can know a file is hidden?
- From: John Stiles <email@hidden>
- Date: Wed, 26 Dec 2007 07:28:34 -0800
I actually don't think you need to do the dot-prefix check in Tiger or
later (didn't try older OSes).
Diederik Hoogenboom wrote:
Must be a typo in the example. Should have been:
NSURL* someURL=getURLFromSomePlace;
LSItemInfoRecord infoRec;
OSStatus err=noErr;
err=LSCopyItemInfoForURL((CFURLRef)someURL,
kLSRequestBasicFlagsOnly,&infoRec);
if (!err && ((infoRec.flags&kLSItemInfoIsInvisible) || [[[someURL
path] lastPathComponent] hasPrefix:@"."]))
{
//file is invisible
}
--
Diederik Hoogenboom
Obvious Matter - DiskLibrary for Mac
http://www.obviousmatter.com
On 26 dec 2007, at 10:13, Constantine wrote:
http://lists.apple.com/archives/cocoa-dev/2002/May/msg00039.html
But there is a mistake of "infoRec" in the code which seems to be
"infoRef"
On Dec 26, 2007, at 4:39 PM, Diederik Hoogenboom wrote:
Hi,
You can get the kLSItemIsInvisible attribute using
LSCopyItemAttributes() function. In addition to this you should also
check if a file begins with a dot ('.').
Diederik
--
Diederik Hoogenboom
Twitter: obviousmatter
Obvious Matter - DiskLibrary for Mac
http://www.obviousmatter.com
On 26 dec 2007, at 09:25, shengjun_guan (管聲俊) wrote:
Dear all,
I want to know a file is hidden.How can i do?Waiting for you
help.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
=============================================
Qi Liu
E-Mail: email@hidden
--You only get one shot, do not miss your chance to blow.
This opportunity comes once in a lifetime.
=============================================
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden