Just recently I discovered that some software would fail to work on partitions that are case-sensitive. My partitions are mostly case-sensitive because I develop some stuff for Linux (which often has case-sensitive file systems).
So, be sure to test your applications on case-sensitive partitions. You can easily create a disk image and mount it for this purpose.
In the case your application needs to know if it is running on a case sensitive partition, here is some sample code. There are many ways to find out the vRefNum, depending on what you have to start with. In this case, I am assuming a path, but you can also get a vRefNum for a BSD partition or other things.
Sample Code follows:
#include <CoreServices/CoreServices.h>
OSStatus getVRefNumFromPath (unsigned char * utf8Path, short * outVRefNum);
int main (int argc, const char * argv[]) {
OSStatus status;
HIOParam HFSParameterBlock;
GetVolParmsInfoBuffer volParamsInfoBuffer;
short vRefNum;
if (argc < 2) // If no parameters were given on the command line...
vRefNum = 0; // take the default volume
else
{
// Get the vRefnum from the paths.
// There are many other ways to get the vRefNum
// I leave that as an excercise to the reader
status = getVRefNumFromPath((unsigned char *)argv[1], &vRefNum);
if (status != noErr)
return status;
}
HFSParameterBlock.ioNamePtr = NULL;
HFSParameterBlock.ioVRefNum = vRefNum;
HFSParameterBlock.ioBuffer = (void*)&volParamsInfoBuffer;
HFSParameterBlock.ioReqCount = sizeof(GetVolParmsInfoBuffer);
status = PBHGetVolParmsSync ((HParmBlkPtr)&HFSParameterBlock);
if (status == noErr)
{
if (volParamsInfoBuffer.vMAttrib & bIsCaseSensitive == bIsCaseSensitive)
puts ("Volume is case-sensitive");
else
puts ("Volume is case-insensitive");
}
else
printf ("Error occured: %d", status);
return status;
}
OSStatus getVRefNumFromPath (unsigned char * utf8Path, short * outVRefNum)
{
OSStatus status;
FSRef myRef;
FSCatalogInfo myCatInfo;
FSSpec myFSSpec;
status = FSPathMakeRef (utf8Path, &myRef, NULL);
if (status == noErr)
status = FSGetCatalogInfo (&myRef, kFSCatInfoVolume, &myCatInfo, NULL, &myFSSpec, NULL);
if (status == noErr && outVRefNum != NULL)
*outVRefNum = myFSSpec.vRefNum; // Or myCatInfo.volume, they are the same
return status;
}