Filenames with Win32 special characters (or: Interix filename compatibility)

Corinna Vinschen
Wed Jul 16 20:38:00 GMT 2008

On Jul 12 13:29, Christopher Faylor wrote:
> On Sat, Jul 12, 2008 at 05:32:46PM +0200, Corinna Vinschen wrote:
> >On Jul 12 09:50, Christopher Faylor wrote:
> >> On Sat, Jul 12, 2008 at 11:37:29AM +0200, Corinna Vinschen wrote:
> >> >What if Cygwin checks itself for the obcaseinsensitivity registry key
> >> >and takes it into account?  If the user *made* the choice, we could be
> >> >case sensitive by default and only case insensitive on mount points
> >> >with the "nocase" (or whatever) option.  Otherwise, if the registry
> >> >key isn't set, all operations are case insensitive as usual.  As for
> >> >the managed mounts, we could drop them entirely
> >> >
> >> >Good?  Bad?  Ugly?
> >> 
> >> That's actually what I thought you were proposing.  Why should Cygwin
> >> assume case sensitivity if the underlying OS doesn't support it?
> >
> >Actually, I wasn't sure what I was proposing :)
> >
> >Assuming the above idea is basically sane, what about grandpa NT4
> >and grandma Win2K?  Both kernels are case sensitive by default and
> >both don't know the above registry key.  Erring on the side of caution
> >*could* mean, that Cygwin only goes case sensitive if the registry
> >exists and is set to 0.  Or, we're progressive and are case sensitive
> >if the registry doesn't exist or is set to 0.
> I would be ok with saying that case sensitivity only works on XP and
> later.

Checked in.  The registry value
HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\kernel\obcaseinsensitive
is tested exactly once at startup of the first Cygwin process.  For each
file, the file system is tested for the FILE_CASE_SENSITIVE_SEARCH flag.
With tweaks.  Samba sets the flag but is case-insensitive for Windows
clients, NFS does not set the flag but is case-sensitive.
Additionally, a mount point in /etc/fstab or /etc/fstab.d/$USER can
get the posix=[0|1] flag, like an ntfs mount on Linux. posix=1, the
default, means case sensitive, posix=0 means case-insensitive.

So, if the above registry key is set, all file access on NTFS and NFS is
case-sensitive by default, unless you set the "posix=0" mount flag in
the fstab file.  FAT and Samba are always case-insensitive, no matter
any registry key or mount flags.

Here are the exceptions from the dynamic case-sensitivity checks:

- The POSIX path of a mount point is always case-sensitive.
- Virtual paths like /proc/cputime or /dev/null are always case-sensitive.
- Registry paths below /proc/registry{32|64}/ are always ...
  case-*in*sensitive because the registry is case-insensitive.
- Tests on file suffixes (".exe", ".lnk", etc.) are always case-insensitive.

I removed the CYGWIN=case_check option.  This was long overdue and with
real case-sensitivity it's entirely obsolete.

The mount(1) command needs still to be changed to reflect all the changes
of the last couple of days.  Chris, would you mind to take a stab at this?

Documentation is in the loop.  Locally I fixed almost all sgml files
to reflect the changes to 1.7.  I'm just halfway through ntsec.sgml,
but utils.sgml is practically unchanged so far and suffers from the fact
that not all utils are fixed for 1.7.  Not to mention that I hate
documenting, so this might take a bit longer.  Stay tuned.

I guess I will upload a new cygwin 1.7.0 package to release-2 tomorrow.

Please test.


Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          cygwin AT cygwin DOT com
Red Hat

More information about the Cygwin-developers mailing list