Re: Create Directories
SkyBlueshoes schreef: Another stupid question, search.cpan.org doesn't like me, lol: Which module is best for creating a directory and all directories in between. Ex: I want to create the directory : \dir1\dir2\dir3\targetdirectory but none of the preceding numbered directories exist... Also look into IO::All. -- Affijn, Ruud Gewoon is een tijger. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/ http://learn.perl.org/first-response
Create Directories
Another stupid question, search.cpan.org doesn't like me, lol: Which module is best for creating a directory and all directories in between. Ex: I want to create the directory : \dir1\dir2\dir3\targetdirectory but none of the preceding numbered directories exist... Sky Blueshoes -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/ http://learn.perl.org/first-response
RE: Create Directories
-Original Message- From: SkyBlueshoes [mailto:[EMAIL PROTECTED] Sent: Tuesday, 23 May 2006 12:38 PM To: beginners@perl.org Subject: Create Directories Another stupid question, search.cpan.org doesn't like me, lol: Which module is best for creating a directory and all directories in between. Ex: I want to create the directory : \dir1\dir2\dir3\targetdirectory but none of the preceding numbered directories exist... Sky Blueshoes use strict; use warnings; use File::Path; eval { mkpath(c:\\a\\test\\path) }; if ($@) { print Couldn't create: $@; } -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/ http://learn.perl.org/first-response
Re: Create Directories
File::Spec if you are working cross platform. then mkdir $path On 5/22/06, Toby Stuart [EMAIL PROTECTED] wrote: -Original Message- From: SkyBlueshoes [mailto:[EMAIL PROTECTED] Sent: Tuesday, 23 May 2006 12:38 PM To: beginners@perl.org Subject: Create Directories Another stupid question, search.cpan.org doesn't like me, lol: Which module is best for creating a directory and all directories in between. Ex: I want to create the directory : \dir1\dir2\dir3\targetdirectory but none of the preceding numbered directories exist... Sky Blueshoes use strict; use warnings; use File::Path; eval { mkpath(c:\\a\\test\\path) }; if ($@) { print Couldn't create: $@; } -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/ http://learn.perl.org/first-response -- Anthony Ettinger Signature: http://chovy.dyndns.org/hcard.html -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/ http://learn.perl.org/first-response
Re: How do I create directories on a Unix box with Perl
On Monday, June 10, 2002, at 07:38 , Mark Underwood wrote: [..] Also appologies for taking so long to get back to you, I wanted to explore some other easier options before trying your suggestion.. hey, I just shifted over to doing it that way myself I always had a simple function that wrapped system(mkdir -p $dir); so not a problem... Then I built one with a recursive walker cause I wanted to do that. I guess this means I have to install a Perl Module correct ? I really wish I could remember I think it comes 'by default' with perl 5.6.1 - but for the life of Me I can not recall nope - a quick check of the CPAN http://search.cpan.org/search?mode=modulequery=File%3A%3APath suggest that it first showed up in 5.003 so it should be there... when in wonder when in doubt - the old version trick will help [jeeves:Library/Perl/File] drieux% perl -MFile::Path -e 'print $File::Path::VERSION \n' 1.0403 [jeeves:Library/Perl/File] drieux% IF you get say: [jeeves:Library/Perl/File] drieux% perl -MFile::WOMBAT -e 'print $File::WOMBAT::VERSION \n' Can't locate File/WOMBAT.pm in @INC (@INC contains: /System/Library/Perl/darwin /System/Library/Perl /Library/Perl/darwin /Library/Perl /Library/Perl /Network/Library/Perl/darwin /Network/Library/ Perl /Network/Library/Perl .). BEGIN failed--compilation aborted. [jeeves:Library/Perl/File] drieux% then the problem is that the Module will have to be downloaded [..] the drieux Babbled: perldoc File::Path and in particular the mkpath function. An illustration of it's use is shown in: http://www.wetware.com/drieux/pbl/misc/linkToNowhere.txt ciao drieux --- -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
How do I create directories on a Unix box with Perl
Hi, I would say this is a newbie question, but since this post is to the perl.beginners list I guess you can assume that it is. I want to create a hieracrchical nested directory structure on the remote Unix server that I use as my host. I can only create single directory which appears under the cgi-bin directory on the server that my perl script runs in but I want to create a nested structure that starts one level up from the cgi-bin. For example if my cgi-bin directory is usr\home\myaccount\cgi-bin I can create a new directory under cgi bin as usr\home\myaccount\cgi-bin\NEWDIR using the following code in the Perl script that runs in the cgi-bin directory: $fileDir = 'NEWDIR'; mkdir($fileDir,'777'); ...but I want to create: usr\home\myaccount\NEWDIR_1\NEWDIR_2\NEWDIR_3 etc etc. Can someone give me an example of how to do this. Many thanks, Mark. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How do I create directories on a Unix box with Perl
On Sunday, June 9, 2002, at 06:53 , Mark Underwood wrote: [..] For example if my cgi-bin directory is usr\home\myaccount\cgi-bin I can create a new directory under cgi bin as usr\home\myaccount\cgi-bin\NEWDIR using the following code in the Perl script that runs in the cgi-bin directory: $fileDir = 'NEWDIR'; mkdir($fileDir,'777'); ...but I want to create: usr\home\myaccount\NEWDIR_1\NEWDIR_2\NEWDIR_3 etc etc. what you are looking for is perldoc File::Path and in particular the mkpath function. An illustration of it's use is shown in: http://www.wetware.com/drieux/pbl/misc/linkToNowhere.txt ciao drieux --- -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]