Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

creating dir with spaces via `system call`

Status
Not open for further replies.

gagz

Programmer
Nov 21, 2002
333
US
just trying to run `mkdir c:\\documents and settings`;

i can't get it to create dir's with spaces... any advice?
 
Code:
$dir="C:/Documents and Settings";
mkdir $dir;

You may need to concern yourself with changing drives
HTH
--Paul

cigless ...
 
Any reason why you're not using the Perl core module, File::path [1] and its mkpath() function? It gives you a lot more control over the directory creation.

Code:
#!/usr/bin/perl -w
use strict;

use File::Path;
my $dir='C:\Documents and Settings';
mkpath($dir);


[1]
Barbie
Leader of Birmingham Perl Mongers
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top