Re: Getting the contenst of a mount point with a NSFileWrapper
Re: Getting the contenst of a mount point with a NSFileWrapper
- Subject: Re: Getting the contenst of a mount point with a NSFileWrapper
- From: Jim Correia <email@hidden>
- Date: Sat, 13 Jul 2002 11:59:39 -0400
On Saturday, July 13, 2002, at 11:23 AM, Sherm Pendley wrote:
On Saturday, July 13, 2002, at 04:04 AM, Georg Tuparev wrote:
wonder if Apple will clean this mess one day, so that we can
start using these methods/classes in command line tools...
I take the phrase "you can't do that" as a challenge. :-)
Looks to me that you *can* use AppKit (its non-GUI classes, at
least) in CLI tools. I tried a simple test, creating a new
"Foundation Tool" in PB, adding AppKit.framework, and NSLog()-ing
the result of mountedLocalVolumePaths. It worked fine.
I assume you wrote something like what I've got below. Once you
link to AppKit, you require a connection to the window server. This
works fine if you are sitting at the console and testing in the
terminal. If you require that your tool work from someone logged in
remotely not sitting at the console, you are SOL. (If you run the
tool as root in that scenario it will work, but that isn't a normal
mode of operation.)
Jim
#import <Foundation/Foundation.h>
#import <AppKit/AppKit.h>
int main (int argc, const char * argv[])
{
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
NSLog(@"%@", [[NSWorkspace sharedWorkspace]
mountedLocalVolumePaths]);
[pool release];
return 0;
}
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.