Re: Determining the canonical case for a file name on HFS+
Re: Determining the canonical case for a file name on HFS+
- Subject: Re: Determining the canonical case for a file name on HFS+
- From: Adam Nohejl <email@hidden>
- Date: Wed, 30 Nov 2005 22:54:04 +0100
2005/11/30 v 22:05, Camillo Lugaresi:
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.
I wouldn't open the file, but using stat() and comparing inodes seems
like a good solution to me.
--
Adam
_______________________________________________
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