User Control Panel
Advertisements

HELP US, HELP YOU!

Copy and paste files

 
Post new topic   Reply to topic    Bot Depot Forum Index -> Perl
View unanswered posts
Author Message
kings_on_steeds
Senior Member
Senior Member


Joined: 05 Apr 2004
Posts: 290
Location: Bookham, Surrey, UK
Reputation: 35.1Reputation: 35.1Reputation: 35.1Reputation: 35.1

PostPosted: Tue Apr 19, 2005 9:21 pm    Post subject: Reply with quote

hi peeps, another noobie post. i had a quick looks on google, but to no avail.

i would like to know how or if i can tell perl to put 2 files into 2 diffrent dir's.

so i would have,

file1.file
file2.file

and they need to go in

x:\file1dir\file1subdir\
x:\file2dir\file2subdir\

can i get perl on startup to see if it has already done this, (i can do that bit), and if not do it (i cant do this bit)

so is there a way, a "filecopy.pm" or something?, thanks guys.
Back to top
mattaustin
Sentinel
Sentinel


Joined: 19 Jul 2004
Posts: 556
Location: Los Angeles, CA
Reputation: 50.7
votes: 1

PostPosted: Tue Apr 19, 2005 9:25 pm    Post subject: Reply with quote

use File::Copy;

copy("file1","file2") or die "Copy failed: $!";

_________________
[ matt ]
Back to top
kings_on_steeds
Senior Member
Senior Member


Joined: 05 Apr 2004
Posts: 290
Location: Bookham, Surrey, UK
Reputation: 35.1Reputation: 35.1Reputation: 35.1Reputation: 35.1

PostPosted: Tue Apr 19, 2005 9:31 pm    Post subject: Reply with quote

wkd, is there a file::paste;? cos i need to put them in diffrent folders.
Back to top
Cer
Upgraded Agent
Upgraded Agent


Joined: 03 Feb 2004
Posts: 3776
Location: Michigan
Reputation: 146.9
votes: 4

PostPosted: Tue Apr 19, 2005 9:43 pm    Post subject: Reply with quote

QUOTE(kings_on_steeds @ Apr 19 2005, 05:31 PM)
wkd, is there a file::paste;? cos i need to put them in diffrent folders.
[right][snapback]47863[/snapback][/right]


That's what File::Copy does. Copy = make a clone of. It doesn't mean rename or move. If you copy something there is now TWO of the same thing. You're just too smart to realize that. <_<

_________________
Current Site (2008) http://www.cuvou.com/
Back to top
kings_on_steeds
Senior Member
Senior Member


Joined: 05 Apr 2004
Posts: 290
Location: Bookham, Surrey, UK
Reputation: 35.1Reputation: 35.1Reputation: 35.1Reputation: 35.1

PostPosted: Tue Apr 19, 2005 9:48 pm    Post subject: Reply with quote

no, i want to copy it and then tell it so save the copy into a new folder some else on the hard-drive. i am confused. i want

file1.file and file2.file, to me moved to

x:\file1dir
and
x:\file2dir
Back to top
mattaustin
Sentinel
Sentinel


Joined: 19 Jul 2004
Posts: 556
Location: Los Angeles, CA
Reputation: 50.7
votes: 1

PostPosted: Tue Apr 19, 2005 9:52 pm    Post subject: Reply with quote

copy("file1.file","x:\file1dir\file1.file");
copy("file2.file","x:\file1dir\file2.file");


it works like dos copy.....realy not hard

_________________
[ matt ]
Back to top
kings_on_steeds
Senior Member
Senior Member


Joined: 05 Apr 2004
Posts: 290
Location: Bookham, Surrey, UK
Reputation: 35.1Reputation: 35.1Reputation: 35.1Reputation: 35.1

PostPosted: Tue Apr 19, 2005 9:54 pm    Post subject: Reply with quote

oh, i understand, thanks, sorrey it is late, i am stupid.
Back to top
Display posts from previous:   
Post new topic   Reply to topic    Bot Depot Forum Index -> Perl All times are GMT
Page 1 of 1

 



Protected by phpBB Security phpBB-TweakS
phpBB Security Has Blocked 9 Exploit Attempts.
Antispam Captcha Mod by phpbb-security.com
Powered by phpBB © 2001, 2005 phpBB Group