PDA

View Full Version : if X on rhs != X on lhs, copy X to 3rd location?


kashin
28-Jul-2010, 09:53 AM
Does anyone have a script that will compare lhs to rhs, and copy all differences to a 3rd location?
This should be simple and perhaps it is. I'm being lazy by asking. Now I will research it myself.

Aaron
28-Jul-2010, 02:07 PM
Hello,

The command you are looking for is the CopyTo script command. It works on the current selection, so you will need to use the select command to select the left side different and newer files. An example could be:

load "c:\folder1" "c:\folder2"
expand all
select left.diff.files left.newer.files
copyto path:base "c:\outputfolder"

lhasadad
28-Jul-2010, 05:55 PM
Will this work if rather than c:\folder2 its a ref to a snapshot?

I have been comparing changes with snapshot and updating a new level of code using the diff.

Aaron
29-Jul-2010, 10:13 AM
Hello,

Yes. You can load to a folder or point to a snapshot file (load "c:\folder1" "c:\folder\snapshot.bcss"), or you can save a session that has your folders and snapshots already set as base folders, then load that session.

A CRC content comparison will only work if the snapshot had CRC values saved with it; otherwise you should use the default timestamp and size comparison.

Chris
30-Jul-2010, 04:24 PM
If you want to catch orphan files, you'll want to add that to the select command for the script:

select left.diff.files left.newer.files left.orphan.files