Copyright: NKI/AvL


Welcome to TreeComp
Thanks for using TreeComp!

TreeComp is a utility to keep 2 directory trees and the files within the directories in sync. The combined tree is displayed using a treeview control with icons indicating the status per directory. Programs to view the differences (i.e. Microsoft's WinDiff) between files with the same name can be launched by double-clicking, as well as editors for a file residing in one of the 2 trees. After inspection files can be copied/deleted as desired. It is an indispensable tool for people sharing a pool of source files, measurement data or articles. It can be used to perform and verify backup operations, recover lost DLL's by comparing a good and a damaged system and lots more!


Comparing trees

Before the tree comparison can be started, the directories to compare need to be specified. To do this, go to "File" | "Select Directories". This will show the following dialog.

Select the directory you want to compare by browsing to the appropriate node and click the node to do the comparison on. Repeat this procedure to select the second directory. As an alternative, the names of the directories to compare can be typed in in the comboboxes at the bottom. When ready, press the OK-button or <Enter> to run the comparison.

If something new is selected, the program will ask if you want to run the comparison immediately. There are several ways to compare the files within the tree. The fastest way is a comparison based on any combination of timestamp, attribute and size. The slowest but most thorough way is a comparison based on timestamp, attribute and content. Here, the entire content is compared, together with the attributes and timestamp. Every combination of timestamp, attribute, size and content is supported.

When you want to perform a comparison based on any combination of timestamp, attribute and size, the program allows for both single-threaded and multi-threaded operation. For most applications the multi-threaded option will be faster, but for specific file structures it might be possible that the single-threaded option outperforms the multi-threaded one. By default, the multi-threaded option is selected.

If you select one of the 16 modes and press "Yes", the comparison is started. Don't worry about files being copied now, this button only runs the comparison and will come up with an overview of the differences between the trees. When "No" is selected, it is also possible to modify other settings and then start the comparison by selecting the first menu item under "Compare Trees". Selecting "More options" also allows for selecting the way the comparison should be performed.

A more advanced option is in the middle of the "Select directories"-dialog. The "Smart select" checkbox specifies whether the program should perform 'intelligent' behaviour when a directory is selected from one of the comboboxes in the lower part of the dialog. The program saves the pair of directories that were compared previously and can then restore the associated directory in the other combobox. I.e. if at day 1 a comparison was done between "C:\Program Files" and "X:\Program Files" (amongst other comparisons) and you now restart the program on day 2, selecting "X:\Program Files" in the right combobox will automatically restore "C:\Program Files" in the left combobox when the checkbox in the middle is checked and the text above it says "Smart select".

After the scan is done, the treeview can be collapsed or expanded using the toolbutton [image] at the top of the treeview.


Inspecting the differences

When the comparison is performed you can view the differences withing the tree. The look and feel of the program are the same as Explorer's, i.e. selecting a directory displays the files within both directories. A screendump of the program after a comparison might look like this:

The colors in the tree view represent the state of the directory, while the colors in the list view represent the state of the file. The icons per directory should be interpreted as follows:

 blue bullet: the directory exists on the left-hand side only (i.e. C:\Quirt\Util).

 red bullet: the directory exists on the right-hand side only (i.e. D:\Quirt\Util).

 purple bullet: the directory exists on both sides and their contents differ.

 black bullet: the directory exists on both sides and their contents are equal.

The icons per file should be interpreted as follows:

 blue bullet: the file exists on the left-hand side only.

 red bullet: the file exists on the right-hand side only.

 mixed color arrow to the left: the file exists both left and right and the right file is newer.

 mixed color arrow to the right: the file exists both left and right and the left file is newer.

 black bullet: the file exists both left and right and the left and right file do not differ. Only visible if the toolbutton with the black bullet is down.

 purple bullet: the file exists on both sides but their sizes differ.

The status bar at the bottom indicates that here 1 file resides on the left side only, 4 files are newer on the left side, 1 file is newer on the right side and 1 file resides on the right side only. Sixty files do not differ or are filtered out.

To inspect the differences per file a program should be available that can compare 2 files graphically, i.e. Microsoft's Windiff.exe. Make it known to TreeComp by entering its name using "File" | "Preferences" under "Windiff".

If this is ready, double-clicking a file that exists on both sides or selecting "Windiff" from the context-menu will launch that program.

A file that exists on a single side only will launch the editor that is specified under "Editor" in the "File" | "Preferences" dialog.


Moving files around

Copying files using TreeComp is a two-step procedure: first select the file(s) that need to be copied and second tell the program what should be done with the selected file(s).

Selecting a file is done by clicking the file in the listview. If more files should be selected, hold down CTRL, and then click other files. If the files that should be selected are consecutive hold down SHIFT, and then click on the last file. A file can be deselected by pressing CTRL+space. A series of files having the same icon are simultaneously selected by single clicking the corresponding icon on one of the toolbars at the top or its associated shortcut key combination.

Pressing one of these buttons while files having a corresponding icon are selected will pop up a dialog in advance of a copy/delete operation to ask for confirmation. A toolbutton with a cross though it should be clicked in order to delete the files matching the underlying icon, i.e. pressing a crossed out blue button without any files selected will select all blue files, pressing it for the second time will pop up a dialog whether the selected files should be removed. Similar options are available in the context-menu.

A way of copying files not possible using a toolbutton is "Copy less recent". This is done in this way because it is not likely that a less recent file is better than a newer one.


Moving directories around

A subdirectory and its entire content can be copied if the target directory is non-existent or empty. This is done by selecting "Copy directory" from the context menu of the treeview.

Other options like renaming or creating directories are also accesible using this context menu. Selecting "Delete directory left" or "Delete directory right" will ask if the masked files should be included, too. If not switched off using "File" | "Preferences" a dialog will pop up with a list of all files and directories that are about to be removed.

To synchronize the left tree to the right tree, select "Advanced" | "Synchronize Left to Right" from the context menu of the treeview:

This will display the following dialog:

Here, you can switch on or off specific parts of the synchronization. If not switched off using "File" | "Preferences", TreeComp will first display a confirmation dialog after pressing OK. "Advanced" | "Synchronize Right to Left" does the same as "Synchronize Left to Right", but in the reverse direction. Be very carefull using these options!


Using filters

TreeComp supports the use of filters to hide information or to make a comparison faster. There are 2 types of filters, File filters and Directory filters, that work slighly different. The filters are specified under "File" | "Preferences" and should be semi-colon (;) seperated. Asterisk-wildcards (*) are supported. Files and directories can both be filtered in and filtered out.

File filters

To avoid having to deal with machine generated files, like temporary files or object files created by a compiler, file filters for filtering out can be applied. The status of files matching a filter out-mask is not incorporated in the treeview, and by default they are not listed in the listview at the right. These files, however, can be inspected by pressing the black bullet button above the middle of the listview. An example of a reasonable file filter is "*.obj;*.res;*.~*".

If you are only interested in certain kinds of files, for instance C++ source files with extension .cpp, the in filter can be set to "*.cpp". Using this mask only the .cpp files determine the icon status of each treeview node, and files with other extensions can be inspected by pressing the black bullet. By default the file in filter is set to *.*.

The interpretation of the icons of the masked files is similar to that of the icons of non masked files. The only difference is that they are partially obscured by horizontal bars.

Directory filters

A directory matching an out filter is not present in the treeview and there is no way to view its content. Only directories matching the in-filter are compared. An example of a reasonable directory out filter is "Obsolete;Obj", while the directory in filter is mostly set to *.*.

On the fly filtering

If a group of files is not of interest, it can be hidden by pressing one of the toolbuttons in the middle. Pressing the toolbutton with the blue bullet down will hide all the files existing only on the left side, while pressing the black button down will hide all the files without differences and the masked files. The toolbars with the red button and the arrowed buttons work similar as the blue button.


Integrated FTP client

TreeComp can also compare files between a local drive or network connection and an FTP server, ideal for updating homepages at an Internet Service Provider's FTP server. The built in FTP client handles all the requests transparently. The only thing that needs to be done is specifying the name of the FTP server, the username, the password and the initial directory on the server in the FTP tab. Furthermore, the port on which the FTP server is running can be specified (default: 21) and a correction (in hours) for the time zone the FTP server uses for reporting time stamps.

The only difference encountered lies in the fact that remote files are first downloaded to the local hard drive before edited/opened as a temporary file. Modifications to the temporary files are not mirrored to the FTP server!


Integrated ZIP support

Another feature of TreeComp is its capability to compare trees within ZIP-files. Just specify the name of the ZIP-file or self-extracting EXE-file in the "Select directories" dialog.

As with the integrated FTP client, the only difference encountered lies in the fact that files residing in a ZIP file are first extracted to the hard drive before edited/opened as a temporary file. Modifications to the temporary files are not mirrored to the ZIP file!


Advanced features

Selecting "File" | "Preferences" allows for configuring TreeComp:

Editor

Enter the name of your favorite editor that TreeComp should launch when "Edit" is selected from the context menu of the listview. The same editor will be launched after a file that exists on a single side is double-clicked.

Windiff

Enter the name of your favorite file-compare utility that TreeComp should launch when "Windiff" is selected from the context menu of the listview. The same editor will be launched after a file that exists on a both sides is double-clicked.

Explorer

Specify here which "Explorer"-program should be called to investigate a directory using an external program when selecting "Explore" using the treeview or listview's context menu.

Explorer Command-Line

This input field specifies which options should be passed to the program to start it in the selected directory. By default, Windows explorer is started using "/n,/e," as command-line switches, that will always start a new explorer (i.e. any other running explorer is left alone), having both a treeview and a listview. More options are described at the Microsoft site.

Proxy for FTP

To access an FTP server though a proxy server, its name can be specified here in the form 'http://<proxy-server>:<port>'. The server should be accessible using WinInet FTP APIs. Leaving this field blank will retrieve the proxy or direct configuration from the registry. Please note that this option was never tested, because a suitable test environment was not available!

Filters

See the section 'Using filters' to understand filtering.

Files are 'old', if older than ... days

Here, you can specify the age in days of files that TreeComp should hide when the checkbox 'Hide old files' on the main TreeComp window is checked. This way, you can exclude all files not refreshed recently.

Filter Daylight Saving Time Differences

This option only has effect if the timestamp is included in the comparison. By checking this box, files having a different timestamp but the disparity equals a whole number of hours are qualified as equal as far as timestamp concerns. I.e. a file on the left side dated 12/30/2000 22:30 is said to be equal to a file on the right side dated 12/30/2000 23:30. This is done to get rid of 'arrow' icons due to different regional settings of various computers. This option is checked by default.

Display Date in yyyymmdd Format

When this box is checked, file dates are shown as yyyymmdd, i.e. a file last modified April 25, 1999 will be displayed as 19990425. If this box is unchecked the locale setting for displaying dates is used instead. This option is checked by default.

Show Confirmation Dialog

This checkbox specifies if operations that perform a file system modification will be preceded by a dialog asking for confirmation. This option is checked by default.

Ignore Attributes of Target File

If this box is checked, the attributes of target files in a file system modification are reset before the operation is started, i.e. if a file is marked read-only, the read-only attribute is removed before it is overwritten. This option is unchecked by default.

Move Local Files to Delete to Recycle Bin

If this option is checked, local files on non-removable drives that would otherwise be deleted are moved to the Recycle Bin instead. This option is by default unchecked.

The "Advanced..." button

The "Advanced..." button right-below will pop up a dialog to specify programs that should be called when binary files are convertible to ASCII before launching the Windiff-program. This is a convenience option; not specifying anything here will do no harm. An example of a program that is useful here is Borland's "Convert.exe" that converts .dfm-files to ASCII.

The editboxes have the following meaning. Suppose that you have a program that converts MS-Word .doc files to ASCII called "C:\Win32App\doc2asc.exe" you can fill in ".doc" under "Extension:", "C:\Win32App\doc2asc.exe" under "Program:", and "%p %q" under "Arguments:". "%p" stands for the name of the .doc-file that will be compared "%q" stands for the temporary output-file. If the program produces a file having the same base name as the .doc file but with a .txt-extension, you need to specify "%p %pp.txt". Finally, select "Add / Modify" to store the information.

File attributes display

File attributes are displayed by selecting "Options" | "File attributes". If a comparison is done based on sttribute (possibly among others) this option is automatically switched on.


Command-line interface

TreeComp has support for command line argument passing according to the following format:

TreeComp.exe LeftDirectory RightDirectory [/TIMESTAMP] [/CONTENT] [/ATTRIBUTE] [/SIZE] [/LOGSTATUS] [/SYNCHRONIZE_LEFT_TO_RIGHT|/SYNCHRONIZE_RIGHT_TO_LEFT] [/QUIT_WHEN_CLEAN] [/SINGLETHREADED].

TreeComp will start the comparison between the directories specified by the first 2 arguments without user interaction if both directories are found, based on the specified /TIMESTAMP, /CONTENT, /SIZE and /ATTRIBUTE flags. If none of these 4 flags is passed, the comparison is done based on timestamp and size, in multi-threaded mode. To force TreeComp to do the comparison in single-threaded mode, pass /SINGLETHREADED on the command line. When /QUIT_WHEN_CLEAN is also passed, the program exits with return value 0 if no differences are encountered, otherwise it will operate as started using the Compare Trees menu item.

If /LOGSTATUS is specified all the status messages are logged to <Windows temp dir>\TreeCompLog.txt, usually C:\Temp\TreeCompLog.txt.

If /SYNCHRONIZE_LEFT_TO_RIGHT is passed TreeComp will automatically synchronize the left tree to the right tree WITHOUT ANY CONFIRMATION, i.e. it removes directories existing on the right side only and copy all files from the left side that exist both on the left and the right side. /SYNCHRONIZE_RIGHT_TO_LEFT does the same, but in the reverse direction. Be very careful using these options!


Refreshing

TreeComp is capable of detecting changes while TreeComp is running made by other programs in the watched trees under certain conditions. This feature only works when the monitoring thread is running. It is switched on and off by "Options" | "Monitoring Thread". Changes can't be detected on Windows 95/98/Me machines reached over the network and on FTP servers.

If the monitoring thread is not running, it is possible to update a single directory by selecting "View" | "Refresh" or the F5 key. If the thread is running, a refresh command will process the list of changes immediately, instead of after a 10 second interval.


More information

If you need more information, feel free to contact Lennert Ploeger or visit the TreeComp homepage.

Suggestions, remarks etc. are also welcome at Lennert's mailbox.

Reporting a bug

A bug can be reported by e-mail, preferably with a log-file attached. The log-file can be created by passing the /LOGSTATUS switch to TreeComp at startup. For more details, see the 'Command-line interface'-section.

This program is distributed as freeware. If you like the program, pass it on to others!

Lennert Ploeger

Februari 1st, 2001

Amsterdam

The Netherlands