doswrite Command

Purpose

Copies files to DOS files.

Syntax

doswrite-a ] [  -v ] [  -DDevice ] File1 File2

Description

The doswrite command copies the file specified by the File1 parameter to the DOS file specified by the File2 parameter. The doswrite command copies files to a single DOS diskette. The doswrite command cannot copy files across multiple DOS diskettes.

The doswrite command writes the file specified by the File2 parameter to the DOS device using standard DOS naming conventions. Because the DOS \ (backslash) character can have a special meaning for the DOS operating system, do not use a \ (backslash) when specifying subdirectory names in the File2 parameter. Use the / (slash) character instead.

The doswrite command converts lowercase characters specified in the File1 parameter to uppercase before it checks the DOS device. Because all file names are assumed to be full (not relative) path names, you do not need to add the initial / (slash).

If the file specified in the File2 parameter contains a / (slash), each intervening component must exist as a directory and the last component (the named file) must not exist. Any existing file with the same name is overwritten.

Notes:
  1. The wildcard characters * and ? (asterisk and question mark) are not treated in a special way by this command (although they are by the shell). If you do not specify a file-name extension, the file name is matched as if you had specified a blank extension.
  2. This command must be named doswrite.
  3. A DOS directory holds up to 244 files.

Flags

Item Description
-a Replaces NL (new-line) characters with the CR-LF (carriage return, line-feed) sequence. Ctrl-Z is added to the output at the end of file.
-D Device Specifies the name of the DOS device as /dev/fd0 or /dev/fd1. The default device is /dev/fd0. This device must have the DOS disk format.
-v Writes information to standard output about the format of the disk. Use this flag to verify that a device is a DOS disk.

Examples

  1. To copy a text file to a DOS diskette, enter:

    doswrite  -a chap1 chap1.doc

    This copies the file chap1 in the current directory to the DOS text file \CHAP1.DOC on default device /dev/fd0.
  2. To copy a binary file to a DOS diskette, enter:
    doswrite -D/dev/fd1 /home/fran/testdata /survey/test.dta
    This copies the data file /home/fran/testdata to the DOS file \SURVEY\TEST.DTA on /dev/fd1.
  3. To copy every file in the current directory to a DOS diskette in your default drive, enter:
    for i in *
    do
    doswrite $i $i
    done

Files

Item Description
/usr/bin/doswrite Contains the doswrite command.
/dev/fd0 Contains the device name for diskette drive.