NT (Windows kernel) doesn't care about filenames any more than Linux
NT (Windows kernel) doesn't care about filenames any more than Linux
Posted Mar 30, 2009 10:55 UTC (Mon) by nye (subscriber, #51576)In reply to: NT (Windows kernel) doesn't care about filenames any more than Linux by epa
Parent article: Wheeler: Fixing Unix/Linux/POSIX Filenames
Yes. This is what the POSIX subsystems for NT do; they're implemented on top of the native API, as is the Win32 API. Note that Cygwin doesn't count here as it's a compatibility layer on top of the Win32 API rather than its own separate subsystem.
Unfortunately the Win32 API *does* enforce things like file naming conventions, so it's impossible (at least without major voodoo) to write Win32 applications which handle things like a colon in a file name, and since different subsytems are isolated, that means that no normal Windows software is going to be able to do it.
(I learnt all this when I copied my music collection to an NTFS filesystem, and discovered that bits of it were unaccessible to Windows without SFU/SUA, which is unavailable for the version of Windows I was using.)
Posted Mar 30, 2009 15:13 UTC (Mon)
by foom (subscriber, #14868)
[Link] (1 responses)
You can actually do this through the Win32 API: see the FILE_FLAG_POSIX_SEMANTICS flag for CreateFile.
However, MS realized this was a security problem, so as of WinXP, this option will in normal
circumstances do absolutely nothing. You now have to explicitly enable case-sensitive support on
the system for either the "Native" or Win32 APIs to allow it.
(the SFU installer asks if you want to this, but even SFU has no special dispensation)
Posted Nov 15, 2009 0:06 UTC (Sun)
by yuhong (guest, #57183)
[Link]
>> Does that mean if you code against the NT API directly, you
can create files foo and FOO in the same directory?
NT (Windows kernel) doesn't care about filenames any more than Linux
> Yes. This is what the POSIX subsystems for NT do
NT (Windows kernel) doesn't care about filenames any more than Linux
If that is done, the only processing done on the filename before CreateFile
calls NtCreateFile with the name is that \\.\ is replace with \??\, which is
an alias of \DosDevices\.