Home | Downloads |     Share This Page

File Processor Help

File Processor is Copyright 2002, P. Lutus.
File Processor is CareWare. Read about CareWare at www.arachnoid.com/careware.

The File Processor Home Page is located at www.arachnoid.com/fileprocessor.

File Processor is a Java program, and it requires Java runtime engine 1.4 or better, available at java.sun.com.

*** Caveat

PLEASE BE CAREFUL with this program. If used improperly, it could cause the loss of data. I have written it as carefully as I can, but program errors and user errors are always a possibility. Be sure to back up files to multiple locations if you have any doubt about (1) this program or (2) your knowledge of it.

You are solely responsible for determining whether File Processor meets your needs or is suitable for file maintenance tasks.

*** Introduction

File Processor is a utility program meant to reliably handle files, directories of files, and systems of files. It can intelligently and accurately copy an entire system from one drive to another or one machine to another.

File Processor can also compare entire drives or file systems for equality. Normally it does this by comparing file modification times and lengths, but it can also compare all bytes of all files to assure that two file systems are identical, a slower option (for the more anal among us).

File Processor is normally used in an interactive mode. The user enters a source and destination path, chooses options, and clicks "Start." There is plenty of feedback on what is happening - a log file that can be viewed as the process is underway, various numeric and path displays, and an occasional error message. But File Processor can also be used in a non-interactive mode, using command-line arguments and scripts of such commands in files.

File Processor is network-aware and will accept network names as well as normal file system pathnames on most systems including Windows.

*** First use

The simplest use of File Processor is to back up files from one drive to another. Simply run File Processor, enter the source and destination paths, select the "behaviors" pane and choose a harmless option like "Compare dates and sizes," return to the control/status pane and press "Start." File processor will find and list all files on the destination that are older than those on the source, and, if "Update if sizes differ" has been chosen, those that differ in size.

Once you have satisfied yourself that the program behaves as you expect, you can move on to the "Update files and directories" option. This option should update all files on the destination directory that differ from those on the source.

If "Update if sizes differ" has not been selected, destination files older than those on the source will be updated. If "Update if Sizes differ" is selected, all files with different lengths on the destination will also be replaced.

All very simple, I hope. :)

*** Synchronize mode

The next option takes into account the possibility that the destination drive may contain files and/or directories that are not on the source drive. In this option, the file system image on the source is taken to be the "right", desirable image, and the destination image is shaped to agree with it. This is called "synchronization."

First, select the harmless "Synchronize compare-only" option, and press "Start." The way synchronize works is the destination drive is traversed instead of the source drive, in order to detect files and directories not present on the source drive. Again, a list of files is created (if you have selected "Detailed error/event log").

WARNING: The next step should be take with great care, because it may delete a great number of files, hopefully as you intend.

The reason for caution? If you inadvertently choose a destination path that differs completely from the source path, that has nothing in common with it (no directory or file names in common), File Processor may proceed to delete everything from it. That is logical, but it almost certainly won't be what you intend. So BE CAREFUL.

First, look at the error/event log from the previous step to make sure the listed files are those you intend to delete. And remember you will be given another chance to choose or abort (unless you deselect "Prompt before deleting").

Choose option "Synchronize dest. with source." This option deletes any destination path files or directories not present on the source path. PLEASE make sure you have entered a less important backup path as the destination path, and the primary, to-be-preserved path as the source. Press "Start."

When the program encounters the first destination file or directory not present on the source, (and if "Prompt before deleting", the default, has been selected) it will prompt you for confirmation before deleting the file. At this point you may choose to delete the file or directory, delete all cases, not delete, or abort the process.

*** Non-interactive mode

File Processor can be launched with command-line arguments instead of being configured using keyboard and mouse. It can also be controlled by batch files containing commands with the same syntax.

Here is a simple example:

java -jar FileProc.jar -sp /temp2 -dp /temp3 -cd -ex

The first three fields should be familiar to those accustomed to launching Java programs. The next fields mean:

-sp (path) ; select a source path
-dp (path) ; select a destination path
-cd ; select compare-dates mode
-ex ; execute

The last command is needed to get the program to carry out the instructions without requiring the user to press "Start." Of course, you may want to set up File Processor but not run the command, in which case you can leave this off.

My example above, with one command per line and descriptive comments, can be placed in a file and presented to File Processor this way:

java -jar FileProc.jar -rf (path to command file)

If the file contains File Processor syntax commands, it will be executed as though the commands had been typed into the command line. And, for maximum flexibility, one command file can contain references to other command files, which allows a great deal of flexibility in programming File Processor to do what you want. Here is an example:

Let's say you have placed this in a file named "inner.txt":

-se data -de data ; set up path extensions
-ex ; execute
-se backup -de backup ; set up path extensions
-ex ; execute
-se misc -de misc ; set up path extensions
-ex ; execute

And in a file named "outer.txt", you have placed this:

-uf ; update files
-sp myMainMachine ; set up the source once

-dp netMachine1 ; point at first machine
-rf inner.txt ; execute the inner script

-dp netMachine2 ; point at second machine
-rf inner.txt ; execute the inner script

-dp netMachine3 ; point at third machine
-rf inner.txt ; execute the inner script

Finally, you execute the outer script:

java -jar FileProc.jar -rf outer.txt

In this scheme, the outer script names the machines to be updated, and the inner script names the directories on those machines.

To place these scripts conveniently, I have made File Processor attempt to load the file using the provided path, and if this fails, to assume a location in its own configuration directory, located at (user home directory)/.FileProc. This means if a full path is given, File processor will find the file, and if the file name is given alone, File Processor will look for it in its own configuration directory if it can't load it directly.

In other words, in the above examples using names like "inner.txt" and "outer.txt", those files would be placed in the (user home directory)/.FileProc directory.

*** Arcana

BE SURE TO READ the list of commands and options at the bottom of this help file (Appendix A).

For the option commands, simply issuing the command in a script file or on the command line without any argument asserts it (makes it true). So if I say:

-dl

This means I want a detailed log. If I say:

-dl n

This means I want to disable that feature. One may enter a "y" argument if one wishes, say for clarity, but it is redundant. Only "n" causes a change in the outcome.

To make File Processor run without appearing at all, issue this command first:

java -jar FileProc.jar -vi n (remainder of commands)

To have this effect, the "-vi n" command must be the first issued command.

To make File Processor quit after processing its commands, make this the last issued command:

java -jar FileProc.jar (commands) -qp

In a quirk, one of the options (behaviors pane, right hand side) changes the behavior of a mode (left-hand radio button list). The option "Update if comparison differs", if selected, will make the mode "Compare entire files" overwrite any files it encounters that differ.

I bring this up because normally a "Compare" mode doesn't write anything, but the full-compare mode is so time-consuming that I decided to allow this option.

The other "Update" option, "Update if sizes differ", affects the files that are listed by "Compare dates and sizes" and the files that are copied by "Update Files & Directories." I am sorry these two "Update" options behave so differently. I couldn't think of a convenient way to make them more consistent.

*** The first modified-time issue

Sometimes you will see destination files continue to be listed after you have done everything you can think of to update them and make them agree with the source files. In such a case, please take a closer look at the destination files - you will most likely notice the destination files are newer than those on the source path. Destination files that are the same size as the source files, and newer, will not be overwritten, even if the "Update if sizes differ" option is selected. This is a situation where a full compare might be more appropriate (or, if the files are newer for a reason, it might be a good idea to reverse the source and destination paths to move these files to your main system for preservation).

*** The second modified-time issue

Notice the "Strict time checking" option? It exists because many file systems only date their files with a precision of a few seconds at best. If it is not selected, an error of +- 2 seconds is permitted in comparisons. This is the only way to make File Processor compatible with older, sloppier file systems.

*** Nonexistent destination path

File Processor has two ways to deal with nonexistent initial destination directories, a behavior controlled by the "sd" option. One, it will create a directory it discovers doesn't exist — this is the default behavior. Two, with "sd" selected, it will skip such paths and go on. This feature allows you to use File Processor in complex settings in which a machine may not be available, or have more than one configuration, when this might create an error message and halt the process.

This feature doesn't affect the building of directories scanned within the initial directory, only the presence or absence of the initial destination path, before scanning begins.

*** Sorting it out

To familiarize yourself with File Processor's command-line syntax, do this:

1. Copy this help file from the help window into an editor that will print it for you. Be sure to print Appendix A.

2. Type the various commands, modes and options into a command shell, but don't issue the "-ex" command. Instead, look at the GUI display to see which options have been selected as a result of your entries. This is a way to confirm that you can issue the commands you intend.

3. Do the same thing with command script files - rehearse them without executing them, or use them in comparison modes at first.

4. Use dummy directories to experiment with. Don't unleash File Processor onto your costly network until you are confident that you understand it.

*** Customer Support

Sorry — there isn't any. File Processor is free, these instructions are pretty clear, no one-on-one customer support. This way, I can write more programs. I am sure you will understand.

To report bugs, go to the www.arachnoid.com message board, located at www.arachnoid.com/messages, and post them. Only bug reports, no "How do I ...".



Appendix A: Command-line syntax
------------------------------------------------------------

Modes (only one can be active at a time):

-cd Compare dates & sizes
-ce Compare entire files (slow)
-uf Update files & directories
-um Update modified times
-sc Synchronize compare-only
-ss Synchronize dest. with source

Options (multiple choices may be made):

-is [y/n, no arg: y] Include subdirectories
-st [y/n, no arg: y] Strict time checking
-us [y/n, no arg: y] Update if sizes differ
-uc [y/n, no arg: y] Update if comparison differs
-pd [y/n, no arg: y] Prompt before deleting
-cr [y/n, no arg: y] Copy read-only files
-dl [y/n, no arg: y] Detailed error/event Log
-sd [y/n, no arg: y] Skip nonexistent destinations
-vi [y/n, no arg: y] Visible while running scripts

Actions:

-sp [path] Set source path
-dp [path] Set destination path
-se [path extension] Set source path extension
-de [path extension] Set destination path extension
-rf [filename] Read command file, execute its contents
-wl [filename] Write log file
-ex Execute (must be present for action to be executed)
-qp Quit program

Home | Downloads |     Share This Page