http://qs1969.pair.com?node_id=493161


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.