Perl Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming LanguagesPerl Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now!
  #1  
Old October 16th, 2000, 11:28 PM
ahs ahs is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2000
Posts: 0 ahs User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Can you please tell me what are the functions to copy files and directories in Perl?

------------------
ahs

Reply With Quote
  #2  
Old October 17th, 2000, 01:39 AM
freebsd
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
There is no "copy" function in Perl. However, there are two ways to copy files or dirs in Perl:

1) File::Copy
Copy.pm should came with your Perl by default.

2) Using "cp" command in UNIX within backtick operators. "man 1 cp" to find out the usage yourself, you are on your own with this.

i.e. `cp $old_file $new_file`; #where both variables should have full system path.

Just so you know, Copy.pm simply uses "cp" command in UNIX so you may go ahead and use "cp".
Keep in mind, you need to watch for permission. For $old_file, you, the user Apache runs as, need to have read access while the directory where $new_file resides need to have write permission. For example, if Apache is run as nobody, then that directory needs to have 777 permission.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesPerl Programming > Copying files and directories


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 

IBM developerWorks




© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway