473,382 Members | 1,611 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

mkdir in Perl

Icecrack
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
  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
1 4442
Icecrack
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

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

Similar topics

2
by: Shaun | last post by:
Hello! I can't seem to get paths and variables working together: import os a = 'books' os.chdir( '/test') os.mkdir("/test/"a) the last line does not seem to work. os.mkdir(a) makes the...
5
by: eoindeb | last post by:
I am trying to create a directory on Solaris using the mkdir() function. This works fine when I pass a string literal ("/etc/hosts") to mkdir, but if I try passing a directory pointer to mkdir, it...
2
by: gunaseelan_wipro | last post by:
Hi all, In one of my perl scripts when i try to create a directory using mkdir (), the directory is created but the return code for the mkdir () is 512, the same is the case for copy command. ...
30
by: MikeC | last post by:
Good People, I'm writing a backup utility that uses a chdir() to go into the source directory (in which the files reside that I want to back up), so I don't want to use chdir() to get into the...
8
by: vj | last post by:
How do I do the following unix command: mkdir -m770 test with the os.mkdir command. Using os.mkdir(mode=0770) ends with the incorrect permissions. Thanks, VJ
1
by: oscar78 | last post by:
So in the script I'm writing I need to create a directory. However, when I use the following script, a directory is created, but with a ? attached to the end of my input (which the terminal...
2
by: _q_u_a_m_i_s's | last post by:
Hy, i encountered a weird problem on a server running php5, and apache. Seems like i cannot create folders that end with "/". for example: mkdir("test/") will fail mkdir("test") will work Is...
0
by: kumarboston | last post by:
Hi All, I have data in 20 different folders named from step_1...step_20 and each folder has some files which I am trying to manupulate and after that my program should make directories named...
2
by: ezechiel | last post by:
Hi, I'm working on windows here.. i have a script that makes directories, subdirs (mkdir) and I afterwards set special permissions with xcacls trough a system call. But when I took a closer...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.