Determining the canonical case for a file name on HFS+
site_archiver@lists.apple.com Delivered-To: darwin-dev@lists.apple.com Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:mime-version:content-transfer-encoding:message-id:content-type:to:from:subject:date:x-mailer; b=oH2t3hrKBHFGE9fDbcWOj2Tn8TwRsy3wE5wialH7GQbsqF2AX9n3IT6/VStBXgCPKPS7lN5fqeFPRBUnrWucxWBGH3XvZxg4u/GwceMI9LGvDKaRfgyl/pNISKKK9jsQUOU9HL7EWMEdr2zbAm2B9RIcXhbFVJZdTQdVgEVzwQs= Hello to all subscribers. Thanks, Camillo _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-dev mailing list (Darwin-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-dev/site_archiver%40lists.appl... 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. This email sent to site_archiver@lists.apple.com
participants (1)
-
Camillo Lugaresi