Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight

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*

Replies are listed 'Best First'.
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?

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

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (3)
As of 2022-08-10 16:20 GMT
Find Nodes?
    Voting Booth?

    No recent polls found