Re: "Open dialogue"-like file system browser
Re: "Open dialogue"-like file system browser
- Subject: Re: "Open dialogue"-like file system browser
- From: John Stiles <email@hidden>
- Date: Wed, 18 Jan 2006 10:33:30 -0800
Launch Services is what you're after. Here are the docs:
http://developer.apple.com/documentation/Carbon/Conceptual/
LaunchServicesConcepts/index.html
Launch Services is the reliable way to query a file's visibility or
bundle state. Every other technique has lots of edge cases that don't
work quite right.
On Jan 18, 2006, at 9:54 AM, David Zentgraf wrote:
Okay, I found what I need, but I have no idea how to use it. I'm
finding my way around Cocoa by now, but Carbon is a closed book to
me. The Carbon Finder Reference states these constants can be used:
enum {
...
kHasBundle = 0x2000,
kIsInvisible = 0x4000,
...
};
kHasBundle
For a file, this bit indicates that the file contains a bundle
resource. For directories, this bit is reserved--in which case, set
to 0.
kIsInvisible
The file or directory is invisible from the Finder and from the
Navigation Services dialogs.
But how do I actually use this? There really seems to be no Cocoa
alternative.
Chrs,
Dav
On 2006/01/18, at 15:16, Uli Kusterer wrote:
Am 18.01.2006 um 11:44 schrieb David Zentgraf:
Okay, it's going pretty well so far. I got a nice file browser by
now. I was able to hide the .dot files, but there're still all
sorts of files and directories I don't want in there, namely /
var, /usr, /tmp and so on. What can I use to filter out all the
directories that aren't shown in the Finder either? I can't seem
to find the necessary attributes.
You'll have to check the HFS invisible flag for that. You'll
probably have to use a Carbon call to detect that on a per-file
basis. I believe there are also some special items that Finder
just decides it has to hide, those you'll just have to hard-code.
There used to be a file /.hidden that contained a list of (some)
top-level file names to hide, but last I heard that was retired
with 10.4.
Cheers,
-- M. Uli Kusterer
http://www.zathras.de
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40blizzard.com
This email sent to email@hidden
_______________________________________________
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