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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

;-) The search for a simple way of life ( without find )

Status
Not open for further replies.

weirdcpu

IS-IT--Management
Mar 19, 2005
22
FR
Hello,

In perl, is there a SIMPLE way to coordinate two directories ?

By simple i mean without file::find and its no so easy syntax

For example :

In \tp1 i have 3 files :

iwantit.txt onlyhere.txt thesame.txt

In \tp2 i have 2 files :

iwantit.txt thesame.txt

( \tp1\iwantit.txt is newer than \tp2\iwantit.txt )
( \tp1\thesame.txt is the same file than \tp2\thesame.txt )

Under MS-DOS i could use :

XCOPY \tp1 \tp2 /U /Y to update \tp2 with the newer files from \tp1.

Is there a way to do this easyly with perl ?

thanks
 
I didn't check it cause i'm not home, but it has to work
Code:
#!usr/bin/perl -w
system ("XCOPY \\tp1 \\tp2 /U /Y ");



``The wise man doesn't give the right answers,
he poses the right questions.''
TIMTOWTDI
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top