FutureQuest, Inc. FutureQuest, Inc. FutureQuest, Inc.

FutureQuest, Inc.
Go Back   FutureQuest Community > General Site Owner Support (All may read/respond) > General Coding/Development
User Name
Password  Lost PW

Reply
 
Thread Tools Search this Thread Display Modes
Old 05-06-2000, 05:49 PM   Postid: 20152
Hunkorama417
Site Owner

Forum Notability:
10 pts: User-friendly
[Post Feedback]
 
Join Date: Nov 1999
Posts: 283
How to copy files to a specified folder using Perl?

How do I copy a file to a specified folder using Perl?
------------------
Andrew
56400814
Hunkorama417 is offline   Reply With Quote
Old 05-06-2000, 10:17 PM   Postid: 20153
mike_w
Visitor

Forum Notability:
0 pts:
[Post Feedback]
 
Join Date: Dec 1999
Location: Brooklyn, NY
Posts: 132
There are several ways -

- you can do it the tedious way by opening 2 filehandles and writing the contents of one to the other.

- you can use a module, File::Copy, ex.

use File::Copy;
copy("file_one.txt file_two.txt"

- or easiest, use a system function, ex.

system("cp -pr file_one.txt file_two.txt"

moving it to another directory is just as easy, use an absolute or relative pathname -

system("cp -pr oldfile.txt /big/dom/xtrickortreat/trickster/test1/oldfile.txt"
system("cp -pr oldfile.txt ../test1/newfile.txt"

mike_w is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 visitors)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
Forum Jump


All times are GMT -4. The time now is 07:44 PM.


Running on vBulletin®
Copyright © 2000 - 2013, Jelsoft Enterprises Ltd.
Hosted & Administrated by FutureQuest, Inc.
Images & content copyright © 1998-2013 FutureQuest, Inc.
FutureQuest, Inc.