in reply to Directory checking on Windows XP

I have used -d (and many of the other file test operators) frequently on Windows systems and can assure you that they work. Perhaps you could post a little code that demonstrates the problem?

The most likely issue is that the file path you are testing is not relative to where you think it is. "Wibble/plonk.pl" refers to the file plonk.pl in the Wibble directory relative to the current working directory. (You might notice btw that Windows generally doesn't mind / being used in place of \.)


Perl reduces RSI - it saves typing

Replies are listed 'Best First'.
Re^2: Directory checking on Windows XP
by ack (Deacon) on Sep 22, 2008 at 05:53 UTC

    Thanks, GrandFather, for your response. I appreciate it very much. As with all the other responders, your wisdom always helps me to grow.

    I posted an update to my node and included, as most of the responders wisely suggested, a block of code to illustrate what I am inquiring about. It is not, of course, the full code; but I think it highlights in a way that portrays what I am doing.

    I am including in $entry the full directory path specification, so I'm not clear on why the test would fail if I'm executing the code in a directory different from the one I'm trying to process. But I presume I'm not actually doing what I think I am doing...which is what has me perplexed.

    I am confident that the -d filetest operator is working properly and that it works just fine on Windows (as you most appropriately noted from your own experience). So I'm likewise confident that I'm doing something wrong.

    As I noted in response to another's monk's response, I've tried the code through the debugger and $entry checks out with the proper full path specification. And, of course, I can't see with the debugger what the -d function thinks it is seeing other than the value of $entry. It does, of course, also confirm that it is the }else{ clause that gets executed.

    ack Albuquerque, NM