mount dmg disk
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