in reply to Why is Stat() Not Stating All Files?
If you're planning to filetest the return values out of a "readdir", you'd better prepend the directory in question. Otherwise, because we didn't "chdir" there, it would have +been testing the wrong file. opendir(DIR, $some_dir) || die "can't opendir $some_di +r: $!"; @dots = grep { /^\./ && -f "$some_dir/$_" } readdir(DI +R); closedir DIR;
-- Randal L. Schwartz, Perl hacker
Be sure to read my standard disclaimer if this is a reply.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Why is Stat() Not Stating All Files?
by awohld (Hermit) on May 02, 2005 at 06:06 UTC | |
by PodMaster (Abbot) on May 02, 2005 at 06:27 UTC | |
by awohld (Hermit) on May 02, 2005 at 21:45 UTC | |
by PodMaster (Abbot) on May 03, 2005 at 04:04 UTC |