User Control Panel
Advertisements
HELP US, HELP YOU!
Author
Message
kings_on_steeds Senior Member Joined: 05 Apr 2004Posts: 290 Location: Bookham, Surrey, UK
Posted: Tue Apr 19, 2005 9:21 pm Post subject:
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 Joined: 19 Jul 2004Posts: 556 Location: Los Angeles, CA votes : 1
Posted: Tue Apr 19, 2005 9:25 pm Post subject:
use File::Copy; copy("file1","file2") or die "Copy failed: $!"; _________________ [ matt ]
Back to top
kings_on_steeds Senior Member Joined: 05 Apr 2004Posts: 290 Location: Bookham, Surrey, UK
Posted: Tue Apr 19, 2005 9:31 pm Post subject:
wkd, is there a file::paste;? cos i need to put them in diffrent folders.
Back to top
Cer Upgraded Agent Joined: 03 Feb 2004Posts: 3776 Location: Michigan votes : 4
Posted: Tue Apr 19, 2005 9:43 pm Post subject:
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 Joined: 05 Apr 2004Posts: 290 Location: Bookham, Surrey, UK
Posted: Tue Apr 19, 2005 9:48 pm Post subject:
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 Joined: 19 Jul 2004Posts: 556 Location: Los Angeles, CA votes : 1
Posted: Tue Apr 19, 2005 9:52 pm Post subject:
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 Joined: 05 Apr 2004Posts: 290 Location: Bookham, Surrey, UK
Posted: Tue Apr 19, 2005 9:54 pm Post subject:
oh, i understand, thanks, sorrey it is late, i am stupid.
Back to top