How to delete this file ???

Mark Hammond mhammond at skippinet.com.au
Mon Dec 1 12:42:29 CET 2003


DCK wrote:
> Hello
> 
> I've path to file, which look like this:
> \\COMPUTER\D$\C++\FILE_TO_DELETE.JPG
> This path was generated by os.path.walk() function. When i try to delete
> this file, os.remove() can't find it, os.path.fileexists() can't find it :(
> I can delete other files (i.e. \\COMPUTER\D$\C\FILE_TO_DELETE.JPG). I guess
> there's a problem with this C++ directory (++ exacly). I tried to change it
> to C\+\+, but this still not work. I've no idea how to delete this file.
> 
> I work under WinNT 4.0 with sp6, python 2.3 with unicode support. I have
> adminstrator rights.
> Can somebody help me ?

Are you sure you have quoted your back-slashes correctly?  It works for me:

python -c "import os;print os.path.exists(r'\\eden\e\temp\delme')"
True

Mark.





More information about the Python-list mailing list