CONCAT Version 0.7 Gene Pizzetta December 17, 1989 CONCAT concatenates two or more source files into a destination file, similar to PIP. Unlike PIP, however, CONCAT accepts both named directory (DIR) and drive/user (DU) specifications, which allows elaborate concatenations with input files pulled from various drives and user areas. CONCAT runs under ZCPR3 only. USAGE: CONCAT {dir:}outfile = {dir:}infile {{dir:}infile {...}} {/options} Any file without a DU or DIR specification is assumed to be on the current drive/user. OPTIONS: A Append mode. Appends sources files to end of target file, which must exist. This mode by-passes some of CONCAT's safety features (see below). O Object file mode (CONCAT ignores ^Z characters). The default is text file mode, checking for ^Z (the CP/M end-of-file character). Object file mode is provided because some hard-disk backup programs can split large files across two or more floppy disks. Q Toggle quiet mode. Normally CONCAT prints the names of the output file on the screen, and then the name of each source file as it is read. If a configuration byte at 111h is set to a non-zero value, CONCAT will default to quiet operation, printing only error messages. The Q option toggles operation to the non- default mode. Regardless of the state of the configuration byte, CONCAT defaults to quiet mode if the ZCPR3 quiet flag is set. In that case the Q option will likewise toggle to the non-default (verbose) mode. CONCAT requires an output file and at least one source (input) file. Actually, it can be used as a simple file-copy utility, but that's not its purpose. The same filename may be given repeatedly in the source file list. An equal sign (=) separates the output filename from the source filenames. Commas or spaces, or both, separate multiple source filenames. While the equal sign is required, it may be separated from the filenames by one or more spaces. The same applies to commas, if they are used. For example, concat newfile.txt=file1.txt,file2.txt,file3.txt,file4,txt works the same as concat newfile.txt=file1.txt file2.txt file3.txt file4.txt which works the same as concat newfile.txt = file1.txt, file2.txt ,file3.txt , file4.txt which works the same as concat newfile.txt = file1.txt file2.txt file3.txt, file4.txt A filename cannot begin with a slash unless it is preceded by a DU or DIR specification; otherwise, CONCAT will think it has found an option list. If another file has the same name as the output file, it will be renamed to filetype BAK. CONCAT initially creates the output file with a filetype of $$$. After the copy is successfully completed, any existing BAK is erased, the new BAK file is created, and the output file is renamed to the correct filetype. CONCAT is re-entrant for use with the GO command, although that type of operation has not been extensively tested. APPEND MODE: In append mode (option A) CONCAT by-passes several safety features, so use it with caution. For instance, no temporary file or BAK file is created. The target (output) file must already exist, but it can be zero-length. On error, the output file is closed after appending any text that was read before the error occurred. The output file is not erased. It's a good idea to make sure you have sufficient disk space before using append because your original source file will be irrevocably changed if CONCAT runs out of space before it is finished. Do not attempt to append a file to itself. You're not likely to be happy with the results. Use concatenation mode instead. If you would like to be able to append without using the A option, set up an alias as follows: APPEND CONCAT $* /A ERROR CODES: If an error occurs, such as a source file not found, the incomplete output file is erased and the ZCPR3 program error flag is set. The error flag values are set as follows: 8 = ambiguous or missing filename (output or source) 10 = source or target file not found or not given 11 = disk or directory full (write error) 4 = all other errors An invalid option does not produce an error; it is simply ignored. HISTORY: Version 0.7 -- December 17, 1989 -- Gene Pizzetta Added A (append) option, which by-passes several of CONCAT's safety features. Also, a few more optimizations. Version 0.6 -- December 3, 1989 -- Gene Pizzetta Minor changes in setting error flag. Corrected serious error in detecting top of memory, found by Howard Goldstein, who also suggested several changes to make the code more efficient. Thanks, Howard. Version 0.5 -- November 25, 1989 -- Gene Pizzetta Added Q (quiet) option and error flag support. Fixed parser bug that allowed a null output filename. Now closes output file on error before erasing it, a bug discovered by Howard Goldstein. Version 0.4 -- November 12, 1989 -- Gene Pizzetta Added large output buffer. Corrected error in parsing filespec in current user. Relaxed command line syntax: commas no longer required. Now obeys quiet flag. Version 0.3 -- September 19, 1989 -- Gene Pizzetta First preliminary release. If you have any suggestions for enhancements, I'm anxious to hear them. Most importantly, please report any bugs or other problems. To report bugs or make suggestions: Gene Pizzetta 481 Revere Street Revere, MA 02151 Newton Centre Z-Node: (617) 965-7259 Lilliput Z-Node: (312) 649-1730 Voice: (617) 284-0891