469,344 Members | 5,413 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

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

About file copy in modperl

129 100+
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;
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
3 1700
1,275 Expert 1GB
R u able to go to the Desktop folder from command prompt?
First check that .

Apr 1 '09 #2
129 100+
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
3,503 Expert Mod 2GB
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
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.


Apr 3 '09 #4

Post your reply

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

Similar topics

28 posts views Thread by SpreadTooThin | last post: by
2 posts views Thread by Joey | last post: by
1 post views Thread by sasimca007 | last post: by
3 posts views Thread by sasimca007 | last post: by
1 post views Thread by pavanponnapalli | last post: by
5 posts views Thread by sasimca007 | last post: by
6 posts views Thread by sasimca007 | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.