site_archiver@lists.apple.com Delivered-To: darwin-dev@lists.apple.com User-agent: Thunderbird 2.0.0.14 (X11/20080513) Hi Jeff, Many thanks for this. Your explanation certainly was helpful :) Kind regards, Tim Tim, -Jeff On May 22, 2008, at 11:51 AM, Tim Schooley wrote: Hi folks, Apologies in advance if this is the wrong list (and don't hesitate to point me in the right direction). The code I'm writing needs to programmatically mount a device to a user-specified directory (such as /User/tester/mount_point). Since the FSMountLocalVolumeSync() and co. functions ignore the mount path (why, by the way?), I'm using the DA* functions. Both DADiskMountWithArguments() and DADiskUnmount() work correctly. However, when I mount a device, then open a file in vim within the mount point, and then request an unmount, I recieve the following error code from the "dissenter" object: 0x0000c001. I am retrieving this error code using the normal DADissenterGetStatus() route. The reason I am trying to unmount whilst having an open file within the mount point should be quite obvious - I need to handle cases where the mounted device is busy. Any help would be most appreciated. If you need extra info or code, just yell! :) Kind regards, Tim _______________________________________________ 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 Jeff Johnson wrote: I believe that this is actually just an errno 1 EPERM "Operation not permitted". If you look at <DiskArbitration/DADissenter.h>, you have "typedef mach_error_t DAReturn". The format of a mach error is outlined in <mach/error.h>: it had 6 bits for the system, 12 bits for the subsystem, and 14 bits for the code. The system seems to be err_system(0x0), or err_kern. The subsystem seems to be err_sub(3). In the same header you have unix_error(errno) defined as "(err_kern|err_sub(3)|errno)". Then in <sys/errno.h> you have the error codes. The error itself might not be very helpful, but hopefully this explanation was. My problem is this: what is that code? It certainly isn't a DAReturn code, and I haven't been able to find any documentation on it. It is clear that it is a "device busy" kind of error (see http://www.shirt-pocket.com/forums/archive/index.php/t-689.html), but it'd be nice to know if there are any other "unknown" codes that're going to be returned in the unmount callback! signature.asc