Administration Guide : Command-line manual pages

KUNARC(1) manual page

Name

kunarc, karc - FullPress AppleSingle/AppleDouble/BinHex/MacBinary converter

Synopsis

kunarc [ -trU ] [ -f outfile ] infile...
karc [ -trACDMNZ ] [ -f outfile ] infile...

Description

These utility programs let the user convert between various Macintosh archival formats and the FullPress file format. The supported archive formats are AppleSingle, AppleDouble, BinHex, CAP-AUFS 3.0, Helios Ethershare, MacBinary, TOPS (version 2 or later), IPT uShare 4.1, and Mac ZIP. These formats are used to encode Macintosh specific information (file type and creator, resource fork etc.) into one or more files that can be stored on non-Macintosh file systems. BinHex also encodes files into ASCII, so that they can be transferred via e-mail (i.e. it is similar to uuencode(1) ). AppleDouble is used by some other AppleShare emulators to store Macintosh files on Unix filesystems (e.g. A/UX, GatorShare, and NFS/Share). AppleSingle is used by AppleLink to attach files to e-mail messages.

Karc creates archive files from FullPress files, kunarc creates FullPress files from archive files.

BinHex files usually have a .hqx file suffix. AppleDouble format uses two files. For instance, for a file named foo, only the macintosh data fork will be stored in the file named foo. The resource fork, file creator, type, modification date, etc. are stored in a file named %foo. Kunarc should be run on the file that starts with the '%' character.

Helios Ethershare and IPT uShare files have a .rsrc subdirectory which contains the resource fork of the file contained in the upper directory. Helios Ethershare files with no dataforks only have an entry in this .rsrc subdirectory. Using kunarc on IPT uShare requires using the -U option. kunarc should be run given the name of the .rsrc subdirectory, and will then convert all files in the subdirectory. A side effect of running kunarc on Helios Ethershare and IPT uShare files is that filenames with 8 bit characters (accents and the like) will get renamed using Xinet's 8 bit character mapping. Helios EtherShare and IPT uShare file systems should also have their directory names changed using kunarc with the -h option. See the examples.

MacBinary files usually have a .bin suffix. The kunarc utility supports BinHex 4.0 and MacBinary I & II files. Note that AppleSingle files received from AppleLink via UNIX mail must be run through uudecode first. Kunarc does support compressed AppleLink enclosures, but the AppleLink software or Stuffit Expander must be used to uncompress the resulting file.

ZIP archives can contain more than one file, as well as directories, and will extract the whole tree as long as none of file or directories already exists. This behavior can be changed with either the -O option, which forces overwriting files, if possible, or with the -R option, which causes kunarc to add "_#" to extracted filenames if the path from the ZIP archive already exists. When making a ZIP archive, works differently than when writing other formats if given a directory to process instead of a file. While it still does not descend into subdirectories, karc will store all files it finds in the directory into a single ZIP archive.

Kunarc will use the file name recorded in the archive file, for every infile that is not preceded by an outfile argument.

If you don't use the remove infile option with karc, you must specify an outfile.

Options

-f 
Use the next argument as the name of outfile. If outfile does not contain a path name, the current working directory will be used (rather than any path name that may be contained in infile). If this option is omitted, we try to determine the output filename from infile (and outfile will be placed in the same directory as infile). If the program is kunarc and the input is a ZIP archive, outfile may be an existing directory, which will serve as the root of the extraction tree. If outfile is given as `-', karc writes to the standard output.
-r 
Remove infile after converting it.
-h 
Convert infile Helios EtherShare or IPT uShare directory names, and all subdirectory names, to use Xinet's 8 bit character encoding scheme. This option should be run by itself either before or after converting all the files from Helios EtherShare or IPT uShare format to Xinet format. See the examples below.
-j 
When converting Helios format files and/or directories, this sets the UTF-8 conversion table to assume Japanese Mac encoding (i.e. Shift-JIS). Otherwise, all UTF-8-encoded characters are converted using the Mac Roman table.
-t 
Set the tolerant flag. When this flag is set, kunarc tries to handle apparently invalid files. This is useful for handling files created by programs that do not exactly follow the appropriate file format standard.
-A 
Create an AppleSingle archive.
-B 
Force translation of a BinHex archive.
-C 
Create a CAP/AUFS version 3 archive.
-D 
Create an AppleDouble archive.
-M 
Create a MacBinary archive.
-N 
Create a MacBinary II archive.
-U 
Assume input infile is a IPT uShare file (uShare files are not automatically recognized as they lack an easy "magic" number to recognize).
-Z 
Create a ZIP archive.
infile
This may be a directory (in which case all regular files in infile are processed).

Files

./.HSancillary    
File for additional file information needed by Macintosh.

Examples

Kunarc can be run in batch mode in conjunction with find. (You should run kunarc as root if you use this method). If you are doing this, we suggest piping stdout into a log file so you can look at stderr for any errors. If you don't have a backup of your filesystem, we suggest you don't use the remove option if you use kunarc in batch mode. Instead, you can use another find command to remove the archive files once kunarc has been run successfully. (See examples below).

Convert all AppleDouble files in the directory tree rooted at /usr/mount to FullPress format:


    find /usr/mount -name "%*" -exec kunarc {} \; 
 

Convert all A/UX files in the directory tree rooted at /usr/mount to FullPress format:


    find /usr/mount -type d -name ".AppleDouble" -prune -exec kunarc {} \; 
  
 If this succeeds without incident, use the following commands to remove 

the A/UX directories (which will no longer be necessary). 
  
     find . -name ".AppleDouble" -prune -exec rm -r {} \; 
 

Convert all CAP-AUFS files in the directory tree rooted at /usr/mount to FullPress format:


    find /usr/mount -type d -name ".finderinfo" -prune -exec kunarc {} \; 
  
 If this succeeds without incident, use the following commands to remove 

the CAP directories (which will no longer be necessary). 
  
     find . -name ".finderinfo" -prune -exec rm -r {} \; 
    find . -name ".resource" -prune -exec rm -r {} \; 
 

Convert all TOPS files in the directory tree rooted at /usr/mount to FullPress format:


     find . -name ".rsrc" -prune -o -type f -exec kunarc {} \;  
  
 If this succeeds without incident, use the following commands to remove 

the TOPS directories (which will no longer be necessary). 
  
     find . -name ".rsrc" -exec rm -rf {} \; 
 

Convert all Helios EtherShare files in the directory tree rooted at /usr/mount to FullPress format:


     find . -name ".rsrc" -type d -exec kunarc {} \;  

Convert all IPT uShare files in the directory tree rooted at 
/usr/mountto FullPress format: 

 
      find . -name ".rsrc" -type d -exec kunarc -U {} \;  
  
 You also need to change the directory names from Helios'  
or IPT's 8 bit character encoding scheme to Xinet's encoding scheme.   
This has to be done as a separate step as the find command gets confused 

when directories being searched change names.  Run kunarc with 
the -h flag at the root of the Helios EtherShare or IPT uShare  
directory tree: 
  
     kunarc -h /usr/mount 
  
 If all this succeeds without incident, use the following commands 
to remove the EtherShare or uShare directories (which will no longer  

be necessary). 
  
     find . -name ".rsrc" -type d -exec rm -rf {} \; 
 

Convert all FullPress files in the directory tree rooted at /usr/mount to AppleDouble format (type as one line):


    find /usr/mount \( -type d -name ".HSResource" -prune \)  
        -o \( -name ".HSancillary" \)  
        -o -type f -exec karc -D -r {} \; 
 

Convert AMacFile into uu, which can be appended to messages sent to AppleLink accounts via the Internet AppleLink gateway (e.g. XINET@applelink.apple.com). AppleLink will convert the enclosure back to the original Macintosh file.


    karc -A -f - AMacFile | uuencode AMacFile >! uu 
 

See Also

FullPress Administrator's Guide

Bugs

The tolerant flag does not always work.

If kunarc is used in conjunction with find(1) and the remove flag is on, find may be confused when kunarc deletes files. This will result in spurious error messages (usually something like "cannot stat <filename>"), which may be ignored.

kunarc doesnt do the right thing when given the dataforks for Helios EtherShare and IPT uShare files. Give it the file in the .rsrc directories.

Karc supports only MacBinary, AppleSingle and AppleDouble.