Odd behaviour of os module with a Win2k shared directory

David Hughes dfh at forestfield.co.uk
Fri Jun 25 09:41:00 EDT 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:

Python 2.3.2 (#49, Oct  2 2003, 20:02:00) [MSC v.1200 32 bit (Intel)] on 
win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import os
>>> pth = r'\\nom\dietplan6'
>>> os.path.exists(pth)
False
>>> os.listdir(pth)
['unins000.dat', 'program', 'database', 'resource', 'doc', 'dlm', 
'dp5conv', 'gs', 'Readme.txt', 'dietplan.lic', 'users', 'imports', 
'unins000.exe', 'locks']
>>> os.path.exists(os.path.join(pth, 'program'))
True
>>> os.chdir(pth)
>>> os.getcwd()
'\\\\nom\\dietplan6'
>>> os.path.exists(os.getcwd())
False
>>>

--
Regards, 
David Hughes




More information about the Python-list mailing list