By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,852 Members | 2,259 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,852 IT Pros & Developers. It's quick & easy.

mkdir in Perl

Icecrack
Expert 100+
P: 174
Good day/night,

Im creating a script that creates a folder and moves files inside that folder,

the only problem i'm having is when creating the folder if it does not exist, i have tried different methods, mainly come up with permissions denied.

codes i have used:


Expand|Select|Wrap|Line Numbers
  1. use File::Copy;
  2. use File::Path
  3.  
  4. $folder="test1";
  5. $movelocd="/tmp/inboxtest/$folder";
  6.  
Expand|Select|Wrap|Line Numbers
  1. mkdir ("$movelocd") || die "ALERT $movelocd ERROR: ->>>>>>- $!";
  2.  
Expand|Select|Wrap|Line Numbers
  1. mkdir $movelocd || die "ALERT $movelocd ERROR: ->>>>>>- $!";
  2.  
Expand|Select|Wrap|Line Numbers
  1. mkpath( $movelocd, {verbose => 1} ); 
  2.  

Any Help ?

Kind Regards,

Charlie
Sep 16 '08 #1
Share this Question
Share on Google+
1 Reply


Icecrack
Expert 100+
P: 174
i have Figured this out, i will leave the answer to this as it was not related to Perl but apache user,

I added the www "the apache user" user to a group that had access to the folder,
this allowed it to read and write to the folder,

so please not forget if you are trying to mkdir make sure you have access to it.
Sep 16 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.