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

Discussion in 'Python' started by PerOK, Jan 7, 2009.

  1. PerOK

    PerOK Guest

    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 '\\*.*' ?
     
    PerOK, Jan 7, 2009
    #1
    1. Advertising

  2. PerOK

    Chris Rebert Guest

    Re: listdir reports [Error 1006] The volume for a file has beenexternally 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
     
    Chris Rebert, Jan 7, 2009
    #2
    1. Advertising

  3. RE: listdir reports [Error 1006] The volume for a file has beenexternally altered so that the opened file is no longer valid

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

    -----Original Message-----
    From: [mailto:] On Behalf Of Chris
    Rebert
    Sent: Wednesday, January 07, 2009 6:40 PM
    To: Per Olav Kroka
    Cc:
    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
     
    Per Olav Kroka, Jan 8, 2009
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. kai
    Replies:
    1
    Views:
    366
  2. kai
    Replies:
    0
    Views:
    365
  3. kai
    Replies:
    0
    Views:
    314
  4. kai
    Replies:
    0
    Views:
    309
  5. Replies:
    8
    Views:
    493
    Toby Inkster
    Aug 7, 2006
Loading...

Share This Page