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

About file copy in modperl

100+
P: 129
Hi friends,
I have one small doubt that is, i have to copy one file from tmp folder to the desktop. This is a modperl program, when i write linux command in that modperl program it is recognising tmp folder but it is not recognising the desktop folder. When i run that program in the browser it is telling the error like permission denied. My code is below:

Expand|Select|Wrap|Line Numbers
  1. package practice::filecopy;
  2. sub handler
  3. {
  4. $r=`cp /tmp/31-Mar-2009.csv /home/sasi/Desktop/31-Mar-2009.csv` or die "cant copy the file $!" ;
  5. return OK;
  6. }1;
  7.  
I think the /home/sasi/Desktop/ path is looking for the current folder i.e) /usr/lib/perl/5.8.7/practice (or) /usr/local/apache/htdocs. That's why it is giving the error like that Permission Denied. What is the solution

It is compulsory, please help me.

I am using Linux(Ubuntu),Modperl.
Mar 31 '09 #1
Share this Question
Share on Google+
3 Replies


gpraghuram
Expert 100+
P: 1,275
R u able to go to the Desktop folder from command prompt?
First check that .

Raghu
Apr 1 '09 #2

100+
P: 129
Yes i can go to desktop folder through command prompt , but not through modperl program because we writing the modperl programs in /usr/lib/perl/5.8.7/practice folder. That's why the browser does not recognising the desktop folder through the url, it is checking under current folder.
Apr 1 '09 #3

numberwhun
Expert Mod 2.5K+
P: 3,503
The program is probably looking in the webroot for the folder path. My recommendation would be to make a softlink in the webroot to the Desktop directory you want the files to go to.

You should be able to do that with the following command, assuming you execute this in your webroot (usually /var/www/html, but check your httpd.conf file):

Expand|Select|Wrap|Line Numbers
  1. ln -s /path/to/desktop/folder Desktop
  2.  
The word "Desktop" is what the link will be called where you create it. Replace "/path/to/desktop/folder" with the path to the Desktop folder you want to link to.

Regards,

Jeff
Apr 3 '09 #4

Post your reply

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