FAQ
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Ìtocbody&rs˜4&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 '\\*.*' ?

Search Discussions

  • Chris Rebert at Jan 7, 2009 at 5:40 pm
    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
  • Per Olav Kroka at Jan 8, 2009 at 7:58 am
    FYI: the '/*.*' is part of the error message returned.

    -----Original Message-----
    From: chris at rebertia.com [mailto:chris at rebertia.com] On Behalf Of Chris
    Rebert
    Sent: Wednesday, January 07, 2009 6:40 PM
    To: Per Olav Kroka
    Cc: python-list at python.org
    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

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

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppython-list @
categoriespython
postedJan 7, '09 at 4:17p
activeJan 8, '09 at 7:58a
posts3
users2
websitepython.org

2 users in discussion

Per Olav Kroka: 2 posts Chris Rebert: 1 post

People

Translate

site design / logo © 2022 Grokbase