When did Windows start accepting forward slash as a path separator?

Ronald Oussoren oussoren at cistron.nl
Fri Sep 26 08:44:30 EDT 2003


On 26 sep 2003, at 5:50, Jules Dubois wrote:
>
> The Windows kernels are the same.  The internals of the operating  
> system
> accept either.
>
That's not entirely true, in WinNT derivatives the backslash is the  
real seperator at the kernel level, the Win32 perform some conversion  
that allows forward slashes and recognizes special files like CON, PRN,  
et.al..

To make live even more interesting, only unicode paths with backslashes  
as seperators can address all files (at least when I last looked at it  
about 2 years ago). When using unicodepaths you can use '\\?\' as a  
prefix on paths to turn off the conversion I mention above (see  
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/ 
fileio/base/naming_a_file.asp). The fun you can have on windows, I've  
managed to create files that cannot be removed :-)

Ronald






More information about the Python-list mailing list