Check out the Apple VolumeToBSDNode sample code . I believe that it should have the necessary bits of code.
Description
Shows how to iterate over all mounted volumes and retrieve the BSD node name (/ dev / disk *) for each volume. This information is used to determine if the volume is on a CD, DVD, or other media.
As Kent points out, the call PBHGetVolParmsSyncin this example is out of date. Here diff is used to use the newer function:
- HParamBlockRec pb;
-
-
- pb.ioParam.ioNamePtr = NULL;
- pb.ioParam.ioVRefNum = actualVolume;
- pb.ioParam.ioBuffer = (Ptr) &volumeParms;
- pb.ioParam.ioReqCount = sizeof(volumeParms);
-
-
-
- result = PBHGetVolParmsSync(&pb);
+
+ result = FSGetVolumeParms(actualVolume, &volumeParms, sizeof(volumeParms));
+
source
share