Determining the canonical case for a file name on HFS+
Determining the canonical case for a file name on HFS+
- Subject: Determining the canonical case for a file name on HFS+
- From: Camillo Lugaresi <email@hidden>
- Date: Wed, 30 Nov 2005 22:05:00 +0100
Hello to all subscribers.
I am looking for a way to determine the canonical form for a file
name. Suppose that there is a file named "FILE" in the directory /
folder/, which is on an HFS+ volume: then the canonical form of the
path "/folder/file" would be "/folder/FILE". Both paths refer to the
same file, but the representation on disk is FILE.
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 have thought of opening the file and then using fstat on the
descriptor, but is there a better way to do it?
From a broader point of view, what I need is a reliable solution for
determining if two paths refer to the same file, without assuming
anything about the filesystem on which it is located. I have searched
the archives of this list, but I could not find an answer to this
question.
Thanks,
Camillo
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden