468,316 Members | 1,971 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,316 developers. It's quick & easy.

mkdir in Perl

174 Expert 100+
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
  4. $folder="test1";
  5. $movelocd="/tmp/inboxtest/$folder";
Expand|Select|Wrap|Line Numbers
  1. mkdir ("$movelocd") || die "ALERT $movelocd ERROR: ->>>>>>- $!";
Expand|Select|Wrap|Line Numbers
  1. mkdir $movelocd || die "ALERT $movelocd ERROR: ->>>>>>- $!";
Expand|Select|Wrap|Line Numbers
  1. mkpath( $movelocd, {verbose => 1} ); 

Any Help ?

Kind Regards,

Sep 16 '08 #1
1 4272
174 Expert 100+
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.

Similar topics

5 posts views Thread by eoindeb | last post: by
30 posts views Thread by MikeC | last post: by
8 posts views Thread by vj | last post: by
1 post views Thread by oscar78 | last post: by
2 posts views Thread by _q_u_a_m_i_s's | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.