Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Copying a directory and its contents

Status
Not open for further replies.

fatkid

Programmer
Feb 26, 2002
11
US
I can't seem to find any info on this one. Is it possible to copy a directory and its contents using perl? If so do you know how?

I am looking for something similar to the Unix cmd cp -Rp

I greatly appreciate any help I can get.
 
If you're on a unix system, you can still use the unix command. Just put it in quotes and call it with the system() function. Just beware that if you do this from a cgi program, make SURE you know what directory you are in. You program will execute in your cgi directory, and your path will be based on the full path of your web site, not the directory structure you use in your web pages. To be safe, use
Code:
$ENV{'DOCUMENT_ROOT'}
in your program where you use "/" in your web page. Tracy Dryden
tracy@bydisn.com

Meddle not in the affairs of dragons,
For you are crunchy, and good with mustard.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top