Re: hidden files & NSFileManager
Re: hidden files & NSFileManager
- Subject: Re: hidden files & NSFileManager
- From: Eric Schlegel <email@hidden>
- Date: Fri, 17 Jun 2005 13:50:59 -0700
On Jun 17, 2005, at 1:22 PM, Nick Zitzmann wrote:
On Jun 17, 2005, at 1:10 PM, Luc Vandal wrote:
how can I determine if a file/folder is supposed to be hidden or not?
It's not trivial to do, because there are three different ways a
file could be hidden:
1. If a file's name begins with a period, then it's hidden
2. There's an "invisible" setting in the HFS+ file attributes;
obviously it's hidden if it's set
3. If a file's name is listed inside the .hidden text file in the
same directory, then it's hidden
Your program will have to manually check all three places in order
to determine if the file is hidden.
Another option would be to use the LaunchServices API, which makes
all of these checks for you. Given a path, you could create a
CFURLRef from it and then call LSCopyItemInfoForURL. The
kLSItemInfoIsInvisible flag in the output info record indicates that
the file is invisible.
-eric
_______________________________________________
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