• 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: Getting the contenst of a mount point with a NSFileWrapper
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

References: 
 >Re: Getting the contenst of a mount point with a NSFileWrapper (From: Sherm Pendley <email@hidden>)

  • Prev by Date: [OT] Quartz Extreme in developer previews?
  • Next by Date: Re: NSWindow not restoring location
  • Previous by thread: Re: Getting the contenst of a mount point with a NSFileWrapper
  • Next by thread: Re: Getting the contenst of a mount point with a NSFileWrapper
  • Index(es):
    • Date
    • Thread