LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 03-07-2007, 02:21 AM   #1
indu.a
LQ Newbie
 
Registered: Nov 2006
Posts: 14

Rep: Reputation: 0
create a folder/file within a folder using perl


Hello,

I am new to scripting in Perl.

How do I create a folder/file within a folder using Perl.

I created a folder using :

print `mkdir dir1`; # creates a directory names dir1

Now I need to create a folder in dir1, how do I do it.

Thank You !
 
Old 03-07-2007, 03:43 AM   #2
kshkid
Member
 
Registered: Dec 2005
Distribution: RHEL3, FC3
Posts: 383

Rep: Reputation: 30
Code:
#! /opt/third-party/bin/perl

mkdir("dir1/n1") || die "Unable to create directory <$!>\n";

exit 0
 
Old 03-07-2007, 11:09 PM   #3
indu.a
LQ Newbie
 
Registered: Nov 2006
Posts: 14

Original Poster
Rep: Reputation: 0
Smile

Thank you very much !
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
i can't create folder or file by root user. Linux For Ever Red Hat 7 01-19-2007 03:34 PM
How to create cron job to empty mbox folder/file sjmo2 Linux - General 4 03-23-2006 03:39 PM
perl script help required to create users and changing the owner to pericular folder sridhar11 Programming 2 10-25-2005 03:16 PM
can copy-paste or create new file/folder, if boot from live cd gjo Linux - Distributions 3 09-17-2004 09:43 AM
how can i default the max folder file size when it create inside a folder antony_csf Linux - Software 1 06-17-2004 03:26 AM


All times are GMT -5. The time now is 08:22 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration