C++ (Qt)#include <Files.h> int main( void ){ OSErr err; const char * fileName = "/Users/igorigor/Desktop/Test.png"; // create FSRef FSRef theRef; Boolean isDirectory; err = ::FSPathMakeRef((unsigned const char *) fileName, &theRef, &isDirectory); if (err) return -1; // get catalog info FSCatalogInfo catalogInfo; err = ::FSGetCatalogInfo(&theRef, kFSCatInfoVolume, &catalogInfo, NULL, NULL, NULL); if (err) return -1; printf("Volume ref = %d\n", int(catalogInfo.volume)); // get volume name HFSUniStr255 unicodeVolumeName; FSVolumeInfoParam pb; pb.whichInfo = kFSVolInfoNone; pb.ioVRefNum = catalogInfo.volume; pb.volumeIndex = 0; pb.whichInfo = kFSVolInfoNone; pb.volumeInfo = NULL; pb.volumeName = &unicodeVolumeName; pb.ref = &theRef; err = ::PBGetVolumeInfoSync(&pb); if (err) return -1; char buf[256]; CFStringRef str = CFStringCreateWithCharacters(kCFAllocatorDefault, unicodeVolumeName.unicode, unicodeVolumeName.length); CFStringGetCString(str, buf, 255, kCFStringEncodingUTF8); CFRelease(str); printf("Volume name = %s\n", buf); return 0;}