|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
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
|
|||
|
|||
|
Can you please tell me what are the functions to copy files and directories in Perl?
------------------ ahs |
|
#2
|
|||
|
|||
|
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. |
![]() |
| Viewing: Dev Shed Forums > Programming Languages > Perl Programming > Copying files and directories |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|