site_archiver@lists.apple.com Delivered-To: darwin-dev@lists.apple.com Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:cc:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=YTEcpUwl+f41r5/CElhifIKBGRu+dE6b5CYAWuwzf/U=; b=kJVuWnvyvVtvNQ+LQD7mcaPXrqQzkAM3Ju+SVxgk25PUSwJx/nQdJezz8889lH6NPk axMCz+nNRZIgdmDKek05eCyUj1wPhnJDPCWEEr6cXoqo8jFjZztBViGGQ9n5J7eq6jCZ Ad1teRkLeuh3i3Ys11SRC1n1vCCq2hpbZBr2I= Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=eel3pOSdqGEy/rlzE90fs3Gz1cvjthuMSs6Jz8AZyBI2i7F8bqHOz9hwJlOmrqi8sV WuBr+8VpMp3mKcMYsfpEdjcFCXzO6j9LizOPrXzx+/w5mSEAhtF6Y8zHt/YryYB8CuQ3 f2tbg+2q7Y2J7b6plT+No0006ghc7Vi/1jEC8= I used the following code for unmounting: funUnmount(char* DrivePath) { DADiskRef disk = NULL; DASessionRef session = NULL; session = DASessionCreate ( kCFAllocatorDefault ); if(session == NULL) { printf("session NULL\n"); return 0; } disk = DADiskCreateFromBSDName ( kCFAllocatorDefault, session, DrivePath); if(disk == NULL) { printf("disk NULL\n"); return 0; } printf("disk session %p ref %p\n", session, disk); // Eject the whole disk with all the volumes DADiskRef whole; unsigned flags; whole = DADiskCopyWholeDisk( disk ); if(whole) { DADiskUnmount( whole, kDADiskUnmountOptionWhole, SafeRemovalCallback, ( void * ) ( flags & (1 << 1) ) ); } else { printf("Failed to get whole disk !\n"); } } I tried to use DADiskUnmount() API with disk also instead of whole. I defined SafeRemovalCallback function also and it was called also but my pendrive was still mounted. Regards On Wed, Dec 17, 2008 at 9:03 PM, Jean-Daniel Dupas <devlists@shadowlab.org> wrote:
Try to use the Disk Arbitration Framework:
http://developer.apple.com/documentation/Darwin/Reference/DiscArbitrationFra...
Le 17 déc. 08 à 16:24, Rakesh Singhal a écrit :
ya i was trying on Leopard only. I need something that can work on both (Tiger and Leopard). I have path to volume (/Volume/MyPenDrive) and I want to unmount it.
please suggest me.
On Wed, Dec 17, 2008 at 8:14 PM, Philip Aker <philip.aker@shaw.ca> wrote:
On 2008-12-17, at 04:52:40, Rakesh Singhal wrote:
Hi all
I am trying to unmount a pendrive using "disktool -u /Volume/MyPenDrive" but It gives the following message and does not unmount:
/Volume/MyPenDrive will be unmounted... ***Notifications Complete fro type 1
I am not getting what is this :(
please suggest to unmount any drive from program.
What OS version are you using? <x-man-page://disktool> on Leopard shows that it's been deprecated since 2004.
Philip Aker echo astwta@lvpc.dslh@nl | tr a-z@. p-za-o.@
Democracy: Two wolves and a sheep voting on lunch.
_______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-dev mailing list (Darwin-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-dev/devlists%40shadowlab.org
This email sent to devlists@shadowlab.org
_______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-dev mailing list (Darwin-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-dev/site_archiver%40lists.appl... This email sent to site_archiver@lists.apple.com
participants (1)
-
Rakesh Singhal