About Integrity 2.0

 

A utility for creating MD5 Digest checksums on the Macintosh platform [OS 7 - 9], Integrity operates on single files or in batch mode, providing separate checksums for the data fork, resource fork and a combined checksum for both forks. Integrity also provides tools for comparing files and folders, binhex 4.0 encoding and decoding of files, and separating and rejoining data and resource forks.

 

Integrity is written in (Mac)Perl and packaged as a run time executable that does not require a separate installation of Perl. 

 

Installing Integrity

 

Integrity comes as a Self Expanding Archive. Just double click to decompress and save to your hard disk.

 

NOTE: Integrity has some accompanying support libraries in the Lib folder.  Integrity and the Lib folder must reside in the same directory as each other!! If you wish to place integrity somewhere else on your hard disc use a Finder alias instead.

 


Configuring Integrity

 

Setting Preferences

 

From the file Menu, choose “Preferences…”

 

 

This will open the preference settings dialog…

 

 

 


 

Integrity has four user definable settings:

        

         Include data fork in batch output    

When this option is checked Integrity will output the MD5 checksum of the data fork in addition to the full file checksum when processing batches of files.

        

         Include resource fork in batch output

When this option is checked Integrity will output the MD5 checksum of the resource fork in addition to the full file checksum when processing batches of files.

 

         Disable recursive directory search

By default, Integrity will search folders recursively when generating checksums in batch mode. Check this option if you only want to search folders one level deep when batching files.

        

Note: The option applies only to file batches when generating checksums. It has no effect when comparing folders. Folder compare operations are always limited to one level deep searches!

 

         Select text editor

This option determines what creator application type will be assigned to the output files that Integrity creates when saving data.


 

 

Increasing Memory Allocation

 

In the Finder select Integrity…

 

 

 

Select “Memory” from the Get Info sub-menu under the Finder’s File menu…

 

 

Enter the new memory allocation into the Preferred Size text box.

 

 

Close the dialog.


Generating a Checksum for a Single File

 

From the Tool menu choose “Calculate File Checksum”…

 

 

 

Select the file you want to build a checksum of…

 

 

 

Once Integrity is done reading the file it will present a checksum browser window.

 

Note: The larger the file, the longer it will take for Integrity to calculate the checksum. You may see a spinning cursor on very large files, be patient!

 

 

 

The checksum browser window is divided into three sections. The top section lists the file name and the full path of the file.

 

Note: The “:” character is used as the file directory separator on the Macintosh platform.

 

The center section of the browser displays the checksum data for the file. The top checksum is for the combined data and resource fork of the file. The next is just the data fork, and the last is just the resource fork.  The copy buttons next to each checksum can be used to place the associated checksum onto the clipboard. This allows for easy copying and pasting of the value without requiring you to select the text. This should safeguard against accidental changes when copying.

 

Note: The Macintosh clipboard only holds one text value at a time! However, the dialog is non-modal so you may leave it open until you have copied all necessary checksums.

 

The bottom section contains the OK button. Click this to dismiss the dialog box.


 

 

Generating Checksums for a Batch of Files

 

When starting a batch you may either build a new batch document or open an already existing document and append the new data. Batch documents are just text files with the various fields delimited by tabs and files delimited by new lines. The format of the delimited text is:

 

MD5[FILE]   MD5[DATA FORK]   MD5[RESOURCE_FORK]   FILE NAME   FULL PATH

 

Note: MD5[DATA FORK] and MD5[RESOURCE FORK] are optional. You may use the Preference dialog described in Section II Configuring Integrity to omit them if you wish.

 

To create a new batch document

 

Select “New” from the File Menu…

 

 

 

A status window will open…

 

 

To append data to an existing batch document

 

Select “Open” from the File menu…

 

 

A status window will open displaying the name of the file…

 

 

Note: Because Integrity creates its output as either a SimpleText or BBEdit file; it is possible for you to open any text file for appending. Be careful!

 

Once a document is created or opened

 

Select “Calculate Batch Checksums” from the Tool Menu…

 

 

Select the directory that contains the files you want to process by either entering the directory and choosing “Select Current Directory” or by highlighting the directory in the file list and choosing “Directory.”

 

Note: Unless you have set the preferences to disable recursive file searches, all sub-directories will be included in the batch.

 

Note: Integrity will skip over the System Folder, as it can be dangerous to open the resource fork of certain active System files. If you want to build checksums for the System Folder, make a copy and batch it instead.

 

 

 

 

The status window will indicate that files are being gathered…

 

 

… and a progress bar will appear.

 

 

Note: When the file system is being searched recursively, you will see that the progress bar is updated to reflect the number of files to process as it drills through the file tree. This means that the maximum value is updated on the fly and the bar may jump back and forth.  The bar changes color each time a new directory is entered as well.

 

Once the file list has been built, Integrity will begin calculating checksums. The status window will indicate that checksums are being built…

 

 

… and a progress bar will appear.

 

 

Note: The building checksums progress bar shows the percentage of files that have been completed. If a large file in encountered, the bar will change color for each MB that is processed.

 

Once completed the status window will display a message indicating that unsaved changes exist…

 

 

At this point you may batch another folder, add files using the “Calculate File Checksum” menu item, save using the File menu “Save” item or discard the results using the File menu “Close” item.

 

Note: All data is stored in RAM until you save. You may wish to increase the RAM allocation to Integrity if you are going to be working with large file batches. See Section II Configuring Integrity for instructions on how to increase the memory allocation.

 

Note: Data is sorted before being written to a file. However, when you append to a file, the previous data is not read back into memory, resorted with the new data and then written again. Instead, you will have 2 distinct blocks a sorted data in the file.

 


 

Comparing Two Files

 

Select “File Compare” from the Tool menu…

 

 

A file Chooser will appear for you to pick the first file.

 

 

You will then be given a second file chooser to select the second file, after which a dialog box will indicate if the files are identical or not.

 

Note: if the files are very large, it may take some time for Integrity to calculate the checksums.

 


 

Comparing Two Folders

 

Select “Folder Compare” from the Tool menu…

 

 

A folder chooser will appear, select the first folder…

 

 

…either by entering the directory and clicking the “Select Current Directory” button or by highlighting the desired directory in the file list and clicking “Directory.” You will see the folder batched, one level deep, and will then be prompted to select the folder you wish to compare it too. Once the second folder has been processed the results will be presented in a non-modal dialog box.

 

 

The result will list how many files matched, which files did not match, as well as a list of missing / extra files.

 

Click the “Copy to clipboard” button to place the results on the Finder clipboard or “save to file” to export the results to a text file.

 

Note: Files are matched against one another by using relative file names.  It is possible to have two bit identical files with different names, which will be shown as missing or extra files!

 


 

Binhex / Debinhex Files

 

Select “Binhex” or “Debinhex” from the Tool menu…

 

 

A file chooser dialog will appear. Select the file to be encoded/decoded. The resulting file will be placed in the same directory as the source file. Binhexed files will have an .hqx extension appended to their name.

 


 

Split Forks

 

Macintosh files are complex in that they are constructed with two distinct forks, data and resource. There may be times when it is desirable to archive each fork separately on a non-Macintosh platform. This can be accomplished by separating the data fork from the resource fork and coping the resource information into a new data fork of its own. Integrity does this with the “Split Forks” command. A third additional file is created that contains the File Type and File Creator Metadata as well as a manifest of the related files.


Select “Split Forks” from the Tool menu…

 

 

 

You will be prompted with a standard file chooser to select the file to be split. You will then be prompted to name three new files, one containing the data fork, one the resource fork data in a new data fork and an info file with the associated metadata.

 

Note: If you initially select a file that does not have a resource fork, you will get an error message and the operation will be aborted!  If there is no resource fork, you do not need to split the file. You may however want to split a file that has an empty data fork. This will allow you to copy the resource information into a data fork that can be safely archived on a non-Macintosh platform with the associated metadata. In this case you will still get a 0 byte data file for use when rejoining the forks.

 

 

 

 

 

Figure 1 .Info Metadata

 


 

Join Forks

 

This is the inverse operation to “Split Forks.” Select Join Forks from the Tool menu. You will be prompted first to select the file containing the data fork (.data), next the file containing the resource fork info (.rsrc) and finally the file containing the original file metadata and manifest (.info). You will then be prompted to name the new reconstituted file using a standard file chooser dialog.


 

 

Copyright Notice

 

Integrity © 2001 – 2002 David Ackerman, All rights reserved.

 

Email: dave@therockquarry.com