Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re^2: mkdir problem on windows

by Tanalis (Curate)
on Sep 19, 2005 at 13:51 UTC ( [id://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?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (6)
As of 2024-03-28 21:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found