Tar for the Macintosh Version 4.0 Beta What's New The fourth version of tar for the Macintosh now partially understands SCSI tape drives. Tar can read and write tapes directly, allowing exchange with other systems (like Unix). Tar will now set the modifcation time of extracted files properly. You can also select an option to overwrite existing files. Also, several bugs have also been fixed. *************************** Tar has only been tested with a 150 MB Teac streaming cassette drive and Exabyte 8200 and 8500 drives. *************************** Note I am not going to do further work on this program, and have lost interest in polishing it further. Feel free to take the source and make your own modifications and enhancements. Description This program reads and writes tar format archives. It has been tested against tar running on A/UX (3.0), 4.3 BSD and the GNU tar program (POSIX compatible). Floppies and tapes can be exchanged with other systems (on Unix, use raw devices). The tar archive manipulation code is based on John Gilmore's public domain tar program. Tar is public domain. The source code is available in a separate StuffIt archive. The source code was compiled with the MPW 3.2 C compiler. The resources (tar.r) are in MPW rez format. It has been tested under MacOS 7.0.1 IIsi. Note: tar will only archive the data forks of Macintosh files. The File Menu Create This selection allows you to create a tar archive (variations with selections from the Preferences menu). The first dialog box will either ask you for the name of the tar archive (Standard File) or will ask you to insert a floppy (either insert a floppy or press the Cancel button) or expects the tape to already be in the drive. Warning: the floppy must be formatted before using with tar! Also, using a floppy as the destination of a create will cause the contents to be destroyed! The second dialog box allows you to select the directory (or directories) to be placed into the archive. This is like the Standard File dialog, except that there is another button, "Select". Pressing the select button will place the entire directory shown at the top of the file list into the archive. Pressing the "Open" button when a file in the file list is highlighted is the same as pressing "Select". Pressing "Open" when a directory in the file list is highlighted causes that directory to become the possible selection candidate. The "Cancel" button is used to terminate the archive creation. After each directory is added to the archive, this dialog will appear again to give you the chance to add other directories to the archive. The other buttons behave like their counterparts. You may stop the create by typing "Command-.". Extract This selection allows you to extract a tar archive (from either a file, tape or a floppy). The first dialog box will either ask you for the name of the tar archive (Standard File) or will ask you to insert a floppy or expects the tape to already be in the drive. The second is the directory selection dialog, and is used to tell tar where to place the extracted files (like in Create). You may stop the extraction by typing "Command-.". List This selection allows you to list the contents of a tar archive to either the screen or printer. The only dialog is the tar archive selection (Standard File). You may stop the listing by typing "Command-.". Page Setup This selection allows you to select the page options for printing. Save Preferences This selection will create a preference file (in the System Folder or Preferences folder, if possible) that will cause tar to use the current preferences selected to be used next time tar is launched. Quit Exits tar. The Edit Menu The Edit menu is only used to support desk accessories. The Preferences Menu Any option listed in the Preferences menu will be remembered the next time tar is launched if you select "Save Preferences" in the File menu. Convert Newlines When checked, carriage returns ('\r' or 0x0D) are translated to line feeds ('\n' or 0x0A) during archive creation. During extraction, line feeds are translated to carriage returns. Note this occurs in the body of all files, and is thus useful only for source or text transfers. When not checked, no conversion takes place. This is mutually exclusive with the "Strip LFs" option. Strip LFs (Ext Only) When checked, causes stripping of line feeds that immediately follow carriage returns. In effect, it converts MS-DOS style line endings to Macintosh style line endings. When not checked, no conversion takes place. This is mutually exclusive with the "Convert Newlines" option. Old Tar Compatible When checked, tar will create archives with the old format. Otherwise the new standard format is used. Tar will read archives of either type, regardless of the state of this option. Use Floppy When checked, tar will use a floppy disk as the archive file source or destination. See the warning in the description of Create, above. This option allows the exchange of tar archives on floppies. Note that this is done by treating the floppy as "a single file". On Unix systems, the device file to tell tar to use will be something like "/dev/rfloppy0" or "/dev/rfd0". Note that you must use a preformatted disk, as tar will not format it for you. Most likely, you will have to format it as either a 1.44 MB or 720 KB floppy to be readable in a non-Macintosh drive. Use Tape When checked, tar will use a SCSI tape drive as the source or destination for the archive file. This option allows the exchange of tar archives on tapes. Tape Options This option brings up a dialog box that allows you to set various options for use with tape drives. The most useful is SCSI ID, which must be set to the SCSI ID of the tape drive. Tar tries to double check to prevent non-tape devices from being used. The remaining tape options are for expert use! The three timeout options are in seconds. the 'Min Cmd' timeout is used for non-tape motion commands. The 'Motion' timeout is used for commands that read or write data. An additional second is added for each tape block transferred. Increase this if your drive is slow to start up. The 'Rewind' timeout is used when the tape is rewound (actually, unless your drive operates in buffered mode, the rewind is done asynchronously). If the 'Force Variable Blocking' box is checked, tar will attempt to set the drive to variable block mode using the block size set by the 'Block Size' dialog. If the 'Force Mode Select' box is checked, tar will attempt to send a mode select command to the drive. The 'Density Code', 'Buffered Mode' and 'Speed' fields will be sent in the command. Note these fields are decimal numbers. See the manufacturers documentation for valid values. Block Size This option brings up a dialog box that allows you to set the blocking size. This is arbitrarily limited to between 1 and 256 512-byte blocks (inclusive). For tar archives on disk, this only affects the efficiency of the disk transfer. For floppy archives, the block size should be an integral divisor of the number of sectors on the floppy (for that particular format). For tapes, this will control the efficiency of the transfer. If 'Force Variable Blocking' is set (see above), this will directly control the size of the logical block on the tape. Note that for streaming tapes (Exabyte, Teac, QIC), tar will try to use the native (power on default) block size indicated by the drive. Some streaming tapes (Teac, QIC) will not run in variable block mode. Page Screen Listings When checked, causes the listing of the archive file contents to stop at each screen full. When the message "Press any key to continue" appears, any key press will cause the listing to continue. Note that the "List" archive selection will always be paged in this fashion. List to Printer When checked, causes the listing of the archive file contents to be printed to the current printer. A print job dialog will be shown after the archive file and directory selection dialogs. Note that this will work for all three file options. Set Creator/Type This option brings up a dialog box that allows you to set the Finder Creator and Type for all extracted files. The File List Window In each case (create, extract, list), if the "List to Printer" option is not selected, a file list window will display the files (in Unix pathname format) being inserted, extracted or listed. You may stop the scrolling of this window by typing "Command-S". "Command-Q" will restart the display. Limitations Tar only works under 6.0.5 or later, and only on HFS (or compatible) file systems. Tar does not understand the device, link, FIFO and contiguous file types defined for the tar header. Tar does not allow selective extractions, and will not allow a single file to be placed in the archive (unless it is the only file in a directory). Tar does not include the resource fork. The tar archive format does not allow names longer than 100 characters. For creation, the 100 character limit is relative to the directory being archived, and does not include any part of the pathname for directories leading to it. For extraction, the longest name that will be created is 100 characters, and again, this is relative to the extraction directory. Macintosh file attributes (except for modification date and data fork size) are not kept. In Conclusion The icons are courtesy a kind person in Finland, whose name I've lost. :-(