• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: How can know a file is hidden?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >How can know a file is hidden? (From: shengjun_guan (管聲俊) <email@hidden>)
 >Re: How can know a file is hidden? (From: Diederik Hoogenboom <email@hidden>)
 >Re: How can know a file is hidden? (From: Constantine <email@hidden>)
 >Re: How can know a file is hidden? (From: Diederik Hoogenboom <email@hidden>)

  • Prev by Date: Re: How can know a file is hidden?
  • Next by Date: Re: How can know a file is hidden?
  • Previous by thread: Re: How can know a file is hidden?
  • Next by thread: Re: How can know a file is hidden?
  • Index(es):
    • Date
    • Thread