Re: [perl #30966] Windows PATH variable pieces can be in quotes
by Dave Mitchell other posts by this author
Sep 5 2004 8:41PM messages near this date
[perl #30966] Windows PATH variable pieces can be in quotes
|
Smoke [5.9.2] 23197 FAIL(Fc) bsd/os 4.1 (i386/1 cpu)
On Fri, Aug 06, 2004 at 04:34:56PM -0000, Warren Dodge wrote:
> I just encountered a problem in a script that parses
> the PATH variable and checks to make sure each entry
> has a directory.
>
> It turns out that some program entered something like this
> as a PATH entry. "C:\PATH\BIN"
>
> The quotes were included. I tested this at a CMD prompt
> and indeed it does work as expected. The quotes are shown in a
> set path command.
>
> It seems the -d operator in perl doesn't handle this properly
>
> if ( -d "\"C:/temp\"" )
> {
> print "OK1\n";
> }
> else
> {
> print "BAD1\n";
> }
> if ( -d "C:/temp" )
> {
> print "OK2\n";
> }
> else
> {
> print "BAD2\n";
> }
>
> So I wanted to let you know so perhaps the low level stuff
> could be enhanced.
Thanks for the report.
On reflection, I don't think the basic OS functions should be messed with
the emiulate the particular quirks associated with teh $PATH environment
variable.
Dave.
--
Little fly, thy summer's play my thoughtless hand
has terminated with extreme prejudice.
(with apologies to William Blake)
Thread:
Warren Dodge (via RT)
Dave Mitchell
|