Re: Ejecting disks
Re: Ejecting disks
- Subject: Re: Ejecting disks
- From: Eric Peyton <email@hidden>
- Date: Fri, 1 Mar 2002 20:38:45 -0600
On Friday, March 1, 2002, at 06:38 PM, Steve Gehrman wrote:
I'm trying to eject any ejectable volume. The code I'm using doesn't
seem to work with firewire disks or pci cards. Unfortunately I don't
have either of these to test myself, but I've gotten reports from users.
I've tried 2 methods of ejecting. Neither work for all types if
volumes:
Method - 1:
[[NSWorkspace sharedWorkspace] unmountAndEjectDeviceAtPath:[desc
path]];
This command should work with any type of volume. It calls directly
into Carbon and therefore into Disk Arbitration.
Method - 2:
[[NSTask launchedTaskWithLaunchPath:@"/usr/bin/hdiutil"
arguments:[NSArray
arrayWithObjects:@"eject",[desc mountDevice],nil]] waitUntilExit];
As does this call.
Is there some something I need to do to make this work on all ejectable
volumes?
No, what you need to do is to get your users to send you the output that
appears in the console when the disk doesn't eject.
Eric
Thanks,
-steve
_______________________________________________
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.
_______________________________________________
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.