Odd behaviour of os module with a Win2k shared directory

Tim Golden tim.golden at viacom-outdoor.co.uk
Fri Jun 25 15:53:04 CEST 2004

| I shared a directory, dietplan6, which is actually several 
| levels down in 
| C:\Program files\ on a Windows 2000 machine, called 'Nom'. 
| When I tried to 
| check its existence from another Win2k machine, I got the following 
| strange results:

[snip results showing manifest existence of directory and
contents, os.path.exists to the contrary]

I believe this is because \\machine\name is not considered
a path, but rather a share. Whether this distinction is down
to Microsoft terminology, some decision by the Python library
developers, or (and this is the most likely) the underlying
MS C runtime library, I couldn't say. At a quick inspection,
ntpath.exists calls os.stat, which will refer to nt.stat
and as I don't have the Python source, I can only guess that
that calls some lower level C Runtime function, passing back
whatever that returns.

Personally I would have thought that exists ("\\machine\name\.")
might have given the desired result, but apparently not.


This e-mail has been scanned for all viruses by Star Internet. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:

More information about the Python-list mailing list