listdir reports [Error 1006] The volume for a file has been externally altered so that the opened fi

P

PerOK

os.listdir() keep giving this error:
[Error 1006] The volume for a file has been externally altered so that the
opened file is no longer valid:
'V:\\ETOPOK_Example_MyTestView\\LD_FuncBlocks_013\\cnh1603087_ui_toolkit_mid
p\\test/*.*'

The V:\\ETOPOK_Example_MyTestView refer to a ClearCase (CC) dynamic view.

I have found that MS Visual Studio.Net 2002 and 2003 seems to have this
problem with CC. But I am not using any of MS's Visual Studios. (see
http://www-01.ibm.com/support/docview.wss?ratlid=cctocbody&rs=984&uid=swg21229572)

The seen problem only to appear when some/all caches have forgot about the
directory. If I query the directory again (multiple times) listdir() will
finally return the content of the directory.

The "DOS" command DIR has no problem listing the same directory.

Configuration:
sys.version '2.5.4 (r254:67916, Dec 23 2008, 15:10:54) [MSC v.1310 32 bit (Intel)]'
sys.getwindowsversion() (5, 0, 2195, 2, 'Service Pack 4')
sys.platform
'win32'


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

Chris Rebert

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
 
P

Per Olav Kroka

FYI: the '/*.*' is part of the error message returned.

-----Original Message-----
From: (e-mail address removed) [mailto:[email protected]] On Behalf Of Chris
Rebert
Sent: Wednesday, January 07, 2009 6:40 PM
To: Per Olav Kroka
Cc: (e-mail address removed)
Subject: Re: listdir reports [Error 1006] The volume for a file has been
externally altered so that the opened file is no longer valid
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
 

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top