Announcement

Collapse
No announcement yet.

Folder diffing with .zips giving false positives

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Folder diffing with .zips giving false positives

    I'm trying to diff two folder structures. When Beyond Compare encounters .zip or .jar files inside, it marks them as different even though they are the same. (proof: double click them in the GUI to see the differences, and it gets automatically removed form the list since I'm only showing files with differences, without launching any compare viewer).

    I have timestamp comparison turned off, but it seems like timestamps are the only differences in the files! For example, I create a brand new session and compare just the two .jar files. They are different (red), but by simply turning off timestamp comparison, they are not different.

    It seems like the behavior is just different if folders are your root element in the compare. Does anyone have any ides how I can get around this? I've tried turning on the 'Always treat archive files as folders' option, and I get the correct files marked as different, but when I 'copy to folder', the .jar files that are actually different are recreated, containing only the different files!

    Keep in mind that I'm ultimately planning on scripting this, so it has to work from a script!

    Thanks!

    --pete

  • #2
    Re: Folder diffing with .zips giving false positiv

    As long as "Always Treat Archive Files As Folders" is checked, BC should ignore the timestamp on the archive files themselves and compare based on the files within the archive.

    If you want to ignore timestamp differences, it might work well for you use rules-based comparison to compare the text contents of files.

    It isn't possible to set "always treat archive files as folders" in a script. To work around this, save a session with the setting checked, then load the saved session before loading the folders you want to compare.

    Example:
    load "expand archives session"
    load c:\folder1 c:\folder2

    In regards to the Actions|Copy to Folder command, if folders are selected it will copy folders and archive files that contain the files. If you only select the files within the archives that you want to copy, then select "Don't Keep Upper Folder Structure". This will copy the files without creating archives or subfolders that contain them.
    Chris K Scooter Software

    Comment


    • #3
      Re: Folder diffing with .zips giving false positiv

      Thanks for the fast response! Let me explain what I'm trying to do.

      I am diffing two build-output directories. Basically, I want to get the files that changed between two builds, so I can bundle them up into a patch. Everything is working great except for the .zip/.jar files!

      I am using rule-based comparison.

      I already am loading a session in my script, so I was able to properly test always treat archive files as folders and it's not what I want. If any files inside a .zip/.jar file are different, I want to select the entire .zip/.jar file. But for normal folders, I only want to select the files that are different!

      If I select different folders, then on the copy to folder, I get all the files in that folder, not just the different files! I'm starting to think I may have to just do two passes, one for normal files, and one for archive files.

      Comment


      • #4
        Re: Folder diffing with .zips giving false positiv

        Well, I tried doing a secondary pass with a different session. I was hoping to use the always treat archive files as folders feature, and filter out all files except .zip/.jar. Unfortunately, this does not work. Apparently, you cannot filter include archive files when you are treating them as folders.

        Comment


        • #5
          Re: Folder diffing with .zips giving false positiv

          It is possible to filter on archive files when "Always treat archive files as folders" is turned on. However, because they are treated as folders with this setting turned on, you'll need to use a folder filter.

          Without the setting turned on, you would use the filter "-*.zip;-*.jar". With "Always treat archive files as folders" turned on, use the filter "-\*.zip\;-\*.jar\".
          Chris K Scooter Software

          Comment

          Working...
          X