if X on rhs != X on lhs, copy X to 3rd location?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • kashin
    New User
    • Feb 2008
    • 2

    if X on rhs != X on lhs, copy X to 3rd location?

    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
    Team Scooter
    • Oct 2007
    • 16007

    #2
    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"
    Aaron P Scooter Software

    Comment

    • lhasadad
      Expert
      • Apr 2008
      • 68

      #3
      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.

      Comment

      • Aaron
        Team Scooter
        • Oct 2007
        • 16007

        #4
        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.
        Aaron P Scooter Software

        Comment

        • Chris
          Team Scooter
          • Oct 2007
          • 5538

          #5
          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
          Chris K Scooter Software

          Comment

          Working...