Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re^2: mkdir problem on windows

by Tanalis (Curate)
on Sep 19, 2005 at 13:51 UTC ( #493161=note: print w/ replies, xml ) Need Help??


in reply to Re: mkdir problem on windows
in thread mkdir problem on windows

Interestingly, Windows mkdir has the capability to create any intermediate directories on your behalf - meaning that simply

my $path = "c:\\a\\b\\c\\d" system "mkdir $path";
should work as requested by the OP. Apparently, mkdir requires "command extensions" to be enabled to work in that way, whatever they are, but they're apparently (so say Microsoft) enabled by default for processes running under Windows XP anyway, which I presume extends to the Perl interpreter.

<sarcasm>Who needs cross-compatibility, anyway?</sarcasm> *grin*


Comment on Re^2: mkdir problem on windows
Select or Download Code
Re^3: mkdir problem on windows
by graff (Chancellor) on Sep 19, 2005 at 18:07 UTC
    "should work", except that "c:\a\b\c\d" gets interpolated by perl as "c:" followed by ASCII "bell" ("\a"=0x07), backspace ("\b"=0x08), "ctl-\" ("\c\"=0x1c) and "d".

    The File::Path module is the better solution, really, because it eliminates all the anxiety about backslashes and all the bizarre escaping needed to get them right, along with freeing you from OS-dependent peculiarities.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://493161]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (16)
As of 2014-07-28 20:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (207 votes), past polls