listdir reports [Error 1006] The volume for a file has been externally altered so that the opened file is no longer valid

Chris Rebert clp2 at rebertia.com
Wed Jan 7 12:40:12 EST 2009


> PS: Why does the listdir() function add '*.*' to the path?

Don't know what you're talking about. It doesn't do any globbing or
add "*.*" to the path. Its exclusive purpose is to list the contents
of a directory, so /in a sense/ it does add "*.*", but then not adding
"*.*" would make the function completely useless given its purpose.

> PS2: Why does the listdir() function add '/*.*' to the path on windows and
> not '\\*.*' ?

You can use either directory separator (\ or /) with the Python APIs
on Windows. r"c:\WINDOWS\" works just as well as "c:/WINDOWS/".

Cheers,
Chris

-- 
Follow the path of the Iguana...
http://rebertia.com



More information about the Python-list mailing list