How can I determine whether a certain path points to a hidden file/folder?
NSString *file = @"/my/file/some.where";
BOOL fileIsHidden = // <-- what do I do here?
I know that hidden files are prefixed by a period. This is not the only criteria for a file to be hidden. I’ve read somewhere that there’s a .hidden file that also configures what files are hidden.
Is there a Cocoa/Carbon way to find this out easily without rewriting all this logic and gathering information from various sources?
EDIT: the kLSItemInfoIsInvisible check seems to work for some files. It doesn’t seem to hide:
/dev /etc /tmp /var
All these are hidden by Finder by default.
As the poster pointed out, it doesn’t seem to work on /etc and /var and what not, so I modified the method.
It now takes a “isFile” boolean, YES means its a file, NO means a directory
It seems to work on everything now!