Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Determining the canonical case for a file name on HFS+




2005/12/02 v 1:59, Rehan Rizvi:
Hello Camillo,

You wrote:
"I need to know this for the purpose of comparison, and I cannot
simply do a case-insensitive comparison because I do not know if /
folder/ is on a case-insensitive or case-sensitive volume."

I was just wondering, what is stopping you from finding out what kind of
volume it is?
The information is there in the volume header. If you want to find out
more about volume headers you can do a search on the developer.apple.com
for "tn 1150" or HFSPlusVolumeHeader.

This is not a good solution, because:

1. Other file systems can be case-insensitive too (FAT for instance).

2. There can be other equivalent names with the same case, in HFS for instance composed vs decomposed Unicode - "a\314\201" and "\303\241" is the same file name (represents aacute).

And of course if you're comparing paths you've got from the user, "a/.///./../a/./b" and "a/b" is also the same file.

--
Adam Nohejl
Loki Software
mailto:email@hidden
http://lokisw.com

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/darwin-dev/email@hidden

This email sent to email@hidden
References: 
 >Re: Determining the canonical case for a file name on HFS+ (From: "Rehan Rizvi" <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.