• 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
mount dmg disk
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

mount dmg disk


  • Subject: mount dmg disk
  • From: "gMail.com" <email@hidden>
  • Date: Sun, 14 Mar 2010 20:22:34 +0100
  • Thread-topic: mount dmg disk

Hi,
I can't find a way in Cocoa to mount a dmg disk.
So I would try to call the shell through a NSTask.
I succeed on the Terminal when executing this command line:

echo -n password | hdiutil mount /Users/john/Documents/MyDmgDisk.dmg

But when I pass this command line to the NSTask, I fail all the time.
Furthermore, the app stops to output my NSLog messages to the XCode console.
Please, what do I miss?

NSString    *commandLine = @"echo -n password | hdiutil mount
/Users/john/Documents/MyDmgDisk.dmg";

  NSArray     *args = [NSArray arrayWithObjects:@"-c",  commandLine , nil];
  NSTask        *task = [[NSTask alloc] init];
  [task setLaunchPath:@"/bin/sh"];
  [task setArguments:args];
  [task setStandardOutput:[NSFileHandle fileHandleWithNullDevice]];
  [task setStandardError:[NSFileHandle fileHandleWithStandardError]];
  [task launch];
  [task waitUntilExit];
  int result = [task terminationStatus];
  [task release];


Please note, in case of no password, I simply call
    system("hdiutil mount Users/john/Documents/MyDmgDisk.dmg");
and it works well all the time. But even here, I don't know how to deal with
the password. Any idea?


Regards
--
Leo


_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: mount dmg disk
      • From: Don Quixote de la Mancha <email@hidden>
    • Re: mount dmg disk
      • From: Gwynne Raskind <email@hidden>
  • Prev by Date: Re: #include CommonStrings.txt - 'no such file' error
  • Next by Date: Re: #include CommonStrings.txt - 'no such file' error
  • Previous by thread: Re: Deleted Ressource folder
  • Next by thread: Re: mount dmg disk
  • Index(es):
    • Date
    • Thread