in reply to Re: Problem with opendir/readdir on Win2k
in thread Problem with opendir/readdir on Win2k

I realize (now that I discovered this behaviour) that the workaround is easy as you say: just always use drive:/, not drive:

And that I must document it to users of my scripts and modules, and hope they read the doc.

However, I consider it a bug (ok, counterintutive) because
- in cmd.com, typing dir c: and typing dir c:\, whatever the current directory is, produces the listing of root directory of drive c (as I would expect).
- in my tests, the behavior differs depending on the whereabouts of the perl script. Now that's something that I did not expect.

Rudif
  • Comment on Re: Re: Problem with opendir/readdir on Win2k

Replies are listed 'Best First'.
Re: Re: Re: Problem with opendir/readdir on Win2k
by Albannach (Monsignor) on Feb 19, 2001 at 06:20 UTC
    I can tell you that in the Win95/NT command line "dir c:" gives you the contents of the default directory on the C: drive no matter what your current drive or directory is, and "dir c:\" is the only way to always get the root of C:.

    You can also change the current directory of a drive without "logging" (as they say) to that drive using something like "cd c:\" (this example changes the C: default dir to the root), after which "dir c:" would be equivalent to "dir c:\".

    As to the behaviour changing with the locale of the script, I think that might need a bit more investigation, I've not gone after such a bug but I also haven't notice one in many years of DOS/Win Perling...

    Update ...actually confirmed this behaviour at the NT command line also.

    --
    I'd like to be able to assign to an luser