Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Strange qx under windows behaviour

by leonidlm (Pilgrim)
on Dec 01, 2008 at 10:35 UTC ( [id://727057]=perlquestion: print w/replies, xml ) Need Help??

leonidlm has asked for the wisdom of the Perl Monks concerning the following question:

Hi All,
I encouraged a strange perl behavior.
I am trying to delete a directory (under windows) using:
qx 'rmdir /S /Q \\192.168.16.2\temp\directory';
But from some reason, a couples of days ago it stopped working! I changed it to:
qx 'cmd /C rmdir /S /Q \\192.168.16.2\temp\directory';
And now its working perfect again! Can someone explain that behavior ?
Regards.

Replies are listed 'Best First'.
Re: Strange qx under windows behaviour
by almut (Canon) on Dec 01, 2008 at 13:08 UTC

    Just a wild guess. Have you, by any chance, installed a program named rmdir.exe (e.g. from UnxUtils) a couple of days ago?

    AFAIK, it would be called (when found along PATH) in place of the cmd.exe built-in rmdir, but would presumably choke on /S /Q... — see Windows: system("type ...") vs. system("cmd /c type ...") for a similar case.

Re: Strange qx under windows behaviour
by ikegami (Patriarch) on Dec 01, 2008 at 17:50 UTC
    I don't see how the former could ever have worked.
    >perl -e"print qx'echo /S /Q \\192.168.16.2\temp\directory';" /S /Q \192.168.16.2\temp\directory ^ |
Re: Strange qx under windows behaviour
by graff (Chancellor) on Dec 02, 2008 at 03:50 UTC
    But from some reason, a couples of days ago it stopped working!

    ... and "stopped working" means... what, exactly? What evidence do you have about its failure to work? Usually, there is some sort of error message, and even when there isn't, there is some specific expectation that is not met, for example: files that should no longer exist are still there, or files that should not have been deleted are gone. (Which was it in your case?)

    It's hard to explain something when no evidence is provided.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://727057]
Approved by moritz
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (8)
As of 2024-04-25 11:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found