• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Distinguishing between HFS and HFS+
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Distinguishing between HFS and HFS+


  • Subject: Distinguishing between HFS and HFS+
  • From: Guy Jonathan <email@hidden>
  • Date: Tue, 24 Dec 2002 01:28:05 -0000

Hi folks
Does anyone know how to tell the difference between hfs and hfs+. I've
dabbled about with FSGetVolumeInfo but the FSVolumeInfo I get back for the
root volume seems to be giving me funny results. I tried using this piece of
code (modified slightly) I found earlier from a guy called Rainer
Brockerhoff.

void getInfoForPath(NSString *path) //path being the path to the volume
{
int vRefNum = getVolumeNumberForPath(path);
UInt32 blockSize;
UInt32 dataClumpSize;
UInt8 finderInfo;
UInt16 filesystemID;
UInt16 signature;
unsigned long long returnValue = 0;
OSErr osErr;
FSVolumeInfo info;
osErr = FSGetVolumeInfo(vRefNum, 0, NULL, kFSVolInfoSizes, &info, NULL,
NULL);
if (osErr == noErr) {
signature = info.signature;
filesystemID = info.filesystemID;
printf("Volume path = %s \tVolume Signature = %d\tfilesystemID = %d\r",
[path cString],signature,filesystemID);
}
}

int getVolumeNumberForPath(NSString *thePath)
{
FSRef pathRef;
OSErr osErr;
FSCatalogInfo catInfo;
FSPathMakeRef([thePath UTF8String], &pathRef, NULL);
osErr = FSGetCatalogInfo(&pathRef, kFSCatInfoVolume, &catInfo, NULL,
NULL, NULL);
int returnValue = 0;
if(osErr == noErr) {
returnValue = catInfo.volume;
}
return returnValue;
}

And for each volume I have I get the same result

"Volume Signature = 49739 filesystemID = 37779"

As far as I know "Volume Signature" should be "0" and filesystemID should be
"BD" for hfs and "H+" for hfs+.

Am I doing something wrong?
Is there another way of doing this?

Any help would be appreciated

Thanks
Jonathan Guy



DISCLAIMER: The information in this email is confidential. The contents may
not be disclosed or used by anyone other than the addressee. If you are not
the intended recipient(s), any use, disclosure, copying, distribution or any
action taken or omitted to be taken in reliance on it is prohibited and may
be unlawful. If you have received this communication in error please notify
us by e-mail or by telephone on +44 (0) 20 7779 8888 and then delete the
e-mail and all attachments and any copies thereof.
Euromoney Institutional Investor PLC (its subsidiaries and associates)
cannot accept responsibility for the accuracy or completeness of this email
as it has been transmitted over a public network. If you suspect that the
email may have been intercepted or amended, please call the sender. Any
views expressed by an individual in this email do not necessarily reflect
views of Euromoney Institutional Investor PLC (its subsidiaries and
associates). This communication is from Euromoney Institutional Investor
PLC, a company registered in England and Wales under company number 954730
with registered office at Nestor House, Playhouse Yard, London EC4V 5EX.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Prev by Date: Re: Determining if NS/CFDictionary is mutable?
  • Next by Date: Iterating over a classes methods?
  • Previous by thread: Re: Implementing a status indicator (like iChat's)
  • Next by thread: Re: Distinguishing between HFS and HFS+
  • Index(es):
    • Date
    • Thread