How do I unmount a network volume?
NSWorkspace
thinks they're neither removable nor unmountable. unmountAndEjectDeviceAtPath: @"/Volumes/the network volume in question"
causes nothing whatsoever to happen. There's probably some easy way to do this, sitting right under my nose, but I can't find it.
I don't want to resort to making an Applescript telling the Finder to Eject network volumes and calling it from Cocoa because that's just incredibly icky.
(my dev platform is Tiger, by the way)
Is calling unmount(2)
fair-game? (How odd, most Unix systems name the system call umount()
, not unmount()
, and the manpage frequently calls it umount()
despite the name and Synopsis sections fairly clearly using unmount()
.)
Is the mount in use by anything else? Check lsof(1)
or fuser(1)
output to see which processes, if any, have that filesystem currently open. (Maybe adding a simple chdir("/");
just before your unmount call would do it?)