Re: filepath-on-device to BSD-devpath-of-that-device
site_archiver@lists.apple.com Delivered-To: darwin-dev@lists.apple.com How do I get a BSD device path string (eg: "/dev/rdisk3") that represents the path to the device that holds a file for which I have a path string (eg: "/Volumes/SOME_DATA_CD/A_SUB_FOLDER/THE_FILE.txt")? I can get the dev_t number of the device using stat(), but I'm not sure what to do with that number to get an actual path to the raw device. ... or maybe the stat() step is unnecessary altogether. -pmb _______________________________________________ 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... At 7:38 PM +0000 4/25/07, Chase wrote: So (to sum up)... How do I get a string like "/dev/rdisk3" starting with only the string "/Volumes/SOME_DATA_CD/A_SUB_FOLDER/THE_FILE.txt" ? statfs() takes a path to any file on a given filesystem. It returns f_mntonname, which is the mountpoint for the fs (/Volumes/foo) and f_mntfromname, which is the device node (/dev/disk0s3). If you need the unbuffered device, you'll have to add the 'r' yourself. (/dev/rdisk0s3) This email sent to site_archiver@lists.apple.com
participants (1)
-
Peter Bierman