home *** CD-ROM | disk | FTP | other *** search
- DOSCVT is a small program to convert text files back and forth between
- UNIX(tm) and DOS formats with the following command syntax:
-
- usage: doscvt [-u | -d ] [-v] [-z] [ <filename> ]
- -u : convert <filename> to unix format
- -d : convert <filename> to DOS format
- -v : display the program version and exit
- -z : append a CTRL-Z to the converted file
-
- It defaults to -d on dos systems and -u on unix systems.
-
- DOSCVT, in unix mode, converts <CR><LF> pairs to just <LF> and removes
- any trailing ^Z EOF marker. It looks for <CR><LF> pairs rather than
- merely removing <CR> characters to avoid corrupting files that use
- <CR> to do character overstrike (such as BOLD). DOSCVT also converts
- Unix format to MS-DOS format by adding <CR> before <LF> and,
- optionally, adding ^Z at the end.
-
- When converting files, DOSCVT converts the specified file into a temp
- file and, when finished, deletes the original file and renames the
- temp to the original file name. If there was an error writing the
- temp file, the conversion is aborted, and the input file is left
- intact.
-
- The accessed and modified times of the original are preserved.
-
- Multiple filenames may be specified and each will be converted
- in turn. If no filename is specified, stdin will be converted
- and written to stdout.
-
- DOSCVT is designed so that the same C source file can be compiled
- to run on wither DOS or UNIX systems. I have compiled it with
- Microsoft C V5.1 and MODCOMP GLS C B.2. I tried to stay with the
- ANSI spec but timestamps fell outside of this standard. They do,
- however, seem to work the same on DOS and UNIX systems.
-
- History:
- 2.0 First public release
-
- 2.1 Removed debugging printf of tempfile name
-
- 2.2 Changed file opens to "binary" mode. This
- gave the program control over what went into
- the file.
-
- 2.3 Added code to change the mode of STDIN and STDOUT
- to O_BINARY, allowing DOSCVT to work as a filter
- in a pipeline under MSDOS.
-
- 2.4 Use a fixed tempfile name under MSDOS since the
- "tempnam" function seems to ignore the directory
- hint given in the first parameter if the environment
- variable TMP is set and returns a filename including
- the path specified in TMP. If TMP pointed at another
- device, the rename operation failed.
- Thanks to Peter Herweijer for noticing this.
-
-
- DOSCVT is freeware. You may do what you like with DOSCVT except
- remove my name from it.
-
- I do NOT warrant DOSCVT to be suitable for any purpose at all,
- particularly your purpose.
-
- UNIX is a trademark of AT&T.
-
- DOSCVT is brought to you by:
-
- Norm Brake
- Modular Computer Systems, Inc.
- internet: norm@modcomp.com
- snailmail: PO Box 6099
- Ft Lauderdale, FL 33340-6099