Lugaru's Epsilon
Programmer's
Editor 14b12

Context:
Epsilon User's Manual and Reference
   Commands by Topic
      Getting Help
         Info Mode
         Web-based Epsilon Documentation
      Moving Around
         . . .
         Source Code Browsing Interface
         Comparing Two Buffers
         Comparing Many Files
      Changing Text
         Inserting and Deleting
         Killing Text
         Clipboard Access
         . . .
         Hex Mode
      . . .

Previous   Up    Next
Comparing Two Buffers  Commands by Topic   Inserting and Deleting


Epsilon User's Manual and Reference > Commands by Topic > Moving Around >

Comparing Many Files

The compare-files command compares all files matching a wildcard file pattern to corresponding files in another directory, listing which files are identical, different, or missing.

The pattern may include ** to match a directory hierarchy. For example, dir1/** matches all files in dir1 or its subdirectories, with any level of nesting, while dir1/**/*.h matches only .h files somewhere within that directory hierarchy. If you use a directory name instead of a file pattern, Epsilon compares all files in the hierarchy (same as **). You can use Epsilon's extended file patterns here; see Extended file patterns. If you provide two extended file patterns, instead of a pattern and a directory, Epsilon compares only the files that match the two patterns.

By default, Epsilon compares files while ignoring differences in spaces, tabs, and newlines. That is, any run of one or more spaces, tabs, or newlines (in any combination) matches any other such run. You can use a different rule by running compare-files with a numeric prefix argument, which makes it ask several questions about how to compare.

First, it offers three options for a quicker comparison. Instead of comparing the text of files after reading them with appropriate line translation and Unicode decoding (the default), you can have it compare files byte-for-byte. (This is faster because files with different sizes on disk can be immediately noted as mismatched.) An even faster method is to simply compare two files' timestamps and sizes, without examining their contents at all. (Set the compare-files-method variable if you want a different option by default.) If one of the file patterns refers to a remote file (starts with scp:, for example), then Epsilon always compares file contents, not sizes or dates.

Next (unless it's comparing only timestamps and sizes), compare-files asks how to compare whitespace. You can choose the default rule where any run of spaces, tabs, or newlines matches any other run, a similar rule that just applies to space and tabs (not newlines), or an exact mode where text must match exactly. (Set the compare-files-ignore-spaces variable to change the default rule.) With a prefix argument, compare-files also asks for the name of the destination buffer.

The resulting listing will show pairs of files that match, pairs that don't, and files that are only present in one directory but not the other. Press "a" at any line in the result to visit that line's file in the first directory or pattern you specified, or "b" to visit the one in the second. Press "c" to open both files in a pair of windows, one above the other, or "s" to open both files in side-by-side windows.

You can press "v" or <Enter> on any line to see a visual-diff listing comparing those two files. Press "d" to show a traditional diff listing the differences. Press "l" for a diff listing of every differing file in the two hierarchies.

Press Shift-A to copy file A to file B, or Shift-B to copy file B to file A. You will be prompted to confirm overwriting an existing file. Overwriting a newer file with an older one will mention that in the prompt.

Standard bindings:

    compare-files
 

 Keys  Compare Files mode
 a, b  View file a or file b
 c  View both files
 s  View both files side by side
 v, <Enter>  View a Visual Diff of these two files
 d  View a diff listing of these two files
 l  View a diff of all the differing files
 Shift-A  Copy file a to file b
 Shift-B  Copy file b to file a



Previous   Up    Next
Comparing Two Buffers  Commands by Topic   Inserting and Deleting


Lugaru Epsilon Programmer's Editor 14b12 manual. Copyright (C) 1984, 2020 by Lugaru Software Ltd. All rights reserved.