Rudif has asked for the wisdom of the Perl Monks concerning the following question:
Hi perlmonks of Windows obedience#! perl -w use strict; $|++; sub test { my ($dir) = @_; print "test $dir\n"; opendir DIR, $dir or die "can't open"; my @items = readdir DIR; closedir DIR; print " @items\n"; } test "."; # OK, reads the current directory test "/"; # OK, reads the root of the curent drive test "h:/"; # OK, reads h:/ test "c:/"; # OK, reads c:/ test "h:"; # BAD, reads the current directory when script in h:/somed +ir # BUT OK, reads h:/ when script in c:/somedir test "c:"; # BAD, reads the current directory when script in c:/som +edir # BUT OK, reads c:/ when script in h:/somedir __END__
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Problem with opendir/readdir on Win2k
by Corion (Patriarch) on Feb 19, 2001 at 04:40 UTC | |
by Rudif (Hermit) on Feb 19, 2001 at 05:26 UTC | |
by Albannach (Monsignor) on Feb 19, 2001 at 06:20 UTC | |
|
Re: Problem with opendir/readdir on Win2k
by japhy (Canon) on Feb 19, 2001 at 06:31 UTC | |
|
Re: Problem with opendir/readdir on Win2k
by Rudif (Hermit) on Feb 20, 2001 at 03:47 UTC | |
|
Re: Problem with opendir/readdir on Win2k
by rrwo (Friar) on Feb 20, 2001 at 01:39 UTC |