z3d has asked for the wisdom of the Perl Monks concerning the following question:
Looking for some answers to my "HUH?!?" of the day. I have a script (don't we all?) that needs to perform an action on some files/directories. No biggie. But what I've found is that if there are symlinks in the tree, it performs them against the symlink targets. For instance, say i have /tmp/mike/cat, symlinked to /tmp/dogfood. It seems that perl (5.6.1 and 5.8.2, tested both) will return true on both the -l and the -d tests when scanning /tmp/mike and hitting cat. Is this just a quirk of perl? (Would expect perl to say it's either a dir or a sym, not evaluate both the source and the target). I can explain better if needed, hate posting this, but it *seems* like a bug in the implimentation of the stat tests.
"I have never written bad code. There are merely unanticipated features."
"I have never written bad code. There are merely unanticipated features."
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: stat weirdness?
by Abigail-II (Bishop) on Feb 25, 2004 at 15:12 UTC | |
by antirice (Priest) on Feb 25, 2004 at 15:19 UTC | |
by z3d (Scribe) on Feb 25, 2004 at 16:33 UTC | |
Re: stat weirdness?
by ysth (Canon) on Feb 25, 2004 at 16:55 UTC | |
by z3d (Scribe) on Feb 26, 2004 at 11:59 UTC |
Back to
Seekers of Perl Wisdom