MANISCAN(1L)

NAME
maniscan - scan a manifest for large or binary files

SYNOPSIS
    maniscan [ -e ] [ -f# ] [ -h# ] [ -iname ] [ -lname ] [ -w# ] [ -m ] [ -oname ] [ -s#[k] ] [ -ttext ] [ -ccommand ] [ -v ]

DESCRIPTION
Maniscan reads an existing ``manifest'' (usually created by findsrc(1L) and maintained by makekit(1L)) and scans it for binary files, large files, and files with long lines or that contain non-printing characters. Large files are automatically split and binary files are run through uuencode(1). All problems can be recorded in a log file that should be shipped with the other sources being prepared.

A manifest consist of some header lines, followed by a series of lines that describe the files contained in the shell archives. Each line looks like this;
    filename spaces optional-digits spaces text
For more information on the interpretation of the file, see the makekit documentation.

The original manifest is read from the standard input. An alternate input file may be given by using the ``-i'' option. The generated manifest will be sent to the standard output. An alternate output file may be given by using the ``-o'' option; if the output file exists, maniscan will try to rename it with an extension of .BAK.

As it scans the manifest, maniscan can generate a log of the problems it has found so that the recipient will know to run uudecode(1), use cat(1) to re-create a large file, and so on. To create the log file, use the ``-l'' option to specify the name of the file; if the name is ``-'' the log will go to standard error. If any problems are found, the log file will be added to the new manifest; use the ``-e'' option to exclude it.

The log file is written such that it can often be fed directly into a Unix shell for execution. If a logfile is created, and the ``-t'' option is used, then the text specified with the ``-t'' flag will be echoed to the user's terminal if the logfile is executed. This has the same meaning as the ``-t'' option of shar(1L).

The ``-m'' option is the same as giving the options ``-iMANIFEST -oMANIFEST -h2 -lPACKNOTES'' and is commonly used when reading existing manifests.

After copying any header to the output, maniscan scans each file specified in the manifest. If a named file appears to be a binary file (more than a third of the first 150 bytes are not printable characters), maniscan will create a uuencode(1)'d version, update the manifest, and print a log message. If the original file is named foo.bar, then the new file will be named foo.bar.UU. Maniscan next scans for long lines or lines that have non-printable characters in them (most commonly ASCII control characters). The default line length is 78 characters; this can be changed by using the ``-w'' option; a width of zero skips this check. It also checks for lines that end with a space or tab; to suppress this check use the ``-n'' option. (Some mailers (like those on BITNET) like to strip trailing spaces, while some editors (like GNU Emacs) seem to like to create lines with them; use the flag as it is appropriate for you.) Each time it finds one of these problems, maniscan will write a log entry.

If a file named in the manifest is too large, maniscan will split it up into pieces. The default limit is 50,000 bytes; this may be changed by using the ``-s'' option. If the number given with the ``-s'' option ends with the letter ``k'' then the size is multiplied by 1024, otherwise it is taken to be the desired maximum size in bytes. The manifest will be updated to refer to the split pieces, and a log entry will be written with instructions to merge the pieces. If the original file is named foo.bar, then the pieces will be named foo.bar.1, foo.bar.2, and so on.

The scanning is done in the ``right'' way so that a single large executable named a.out would end up being shipped as a.out.UU.1, a.out.UU.2 ... a.out.UU.n. In no case does maniscan edit or remove any files mentioned in a manifest (except for the manifest itself).

If running on a system where the filenames are of limited length, maniscan will automatically truncate the generated filename to fit inside the limit. To help ensure portability, the ``-f'' flag can be used on any system; this will limit the length of the generated filenames by truncating the base name. For example, with ``-f 14'' specified, the large file InternalDocumentation will be split into pieces named InternalDocu01, and so on. Note that the period is omitted.

If a file named in the manifest does not exist, maniscan can try to create it. The ``-c'' option should be given the name of a command to run, with a single ``%s'' that will replace the filename. For example, ``-c "sccs get %s"'' can be used to do a simple checkout of files from SCCS. The command will be given the full filename as named in the manifest, and will be invoked from within the same directory that maniscan was invoked from, so a wrapper script will often be needed to checkout items within sub-directories:
    #! /bin/sh
    DIR=`expr $1 : '\(.*\)/.*'`
    if test "X${DIR}" = "X" ; then
        DIR="/"
    fi
    FILE=`expr $1 : '.*/\(.*\)'`
    cd $DIR
    checkout $FILE
This option may not be available on all systems.

The ``-v'' option prints out the current version and exits.

CAVEATS
The generated file names are not portable to all systems.

SEE ALSO
makekit(1L).

BUGS
Maniscan will complain it cannot open a file to scan it if it finds a zero character file.