Re: Detecting case-sensitivity of a filesystem
Re: Detecting case-sensitivity of a filesystem
- Subject: Re: Detecting case-sensitivity of a filesystem
- From: Nathaniel Gray <email@hidden>
- Date: Mon, 9 Apr 2007 21:51:17 -0700
On Apr 9, 2007, at 6:04 PM, Don Brady wrote:
On Apr 9, 2007, at 4:57 PM, Nathaniel Gray wrote:
Is there any non-hackish way to detect the case-sensitivity of a
filesystem, like a system call? statvfs doesn't appear to do it
and statfs doesn't help either (case-sensitive and case-
insensitive hfs+ have the same f_type and f_fstypename). Or is
there no avoiding the "create foo, open Foo" hack?
Thanks,
-Nathan
PS: Please CC me with replies.
You can use pathconf(2) with the _PC_CASE_SENSITIVE selector. Note
an EINVAL result for this selector generally implies case-sensitive.
This works nicely for hfs+ in the case-sensitive and insensitive
variants. Unfortunately it looks like EINVAL is returned by smbfs
and fat32, which are both case-insensitive, and ufs, which is case-
sensitive. So I guess this test is only reliable when EINVAL is not
returned (probably just for hfs-family filesystems). Any other
suggestions?
Thanks,
-Nathan
--
>>>-- Nathaniel Gray -- Caltech Computer Science ------>
>>>-- Mojave Project -- http://mojave.cs.caltech.edu -->
_______________________________________________
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