Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ mtools(1) — Tru64 UNIX 5.1b

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

dos2unix(1)

,dsfmgr(8)

hwmgr(8)

ln(1)

mattrib(1)

mcd(1)

mcopy(1)

mdel(1)

mdir(1)

mdiskcopy(1)

mformat(1)

mlabel(1)

mmd(1)

mrd(1)

mread(1)

mren(1)

mtype(1)

mwrite(1)

sysman_station(8)

unix2dos(1)

interface:  fd(7)

mtools(1)  —  Commands

NAME

mtools − Provides a collection of tools for manipulating DOS files

DESCRIPTION

The mtools commands are a public domain collection of programs that let you read, write, and manipulate files on a DOS file system (typically a diskette) from a UNIX system.  Each command attempts to emulate the DOS equivalent command as closely as possible.  The following commands are available:

/usr/ucb/mtools/dos2unix
Converts a DOS file format to an UNIX file format.

/usr/ucb/mtools/mattrib
Changes DOS file attribute options such as whether the file is writeable. This is analogous the the chmod command in UNIX. 

/usr/ucb/mtools/mcd
Changes or reports the DOS working directory

/usr/ucb/mtools/mcopy
Copies DOS files to and from a UNIX operating system

/usr/ucb/mtools/mdel
Deletes a DOS file

/usr/ucb/mtools/mdir
Displays the contents of a DOS directory

/usr/ucb/mtools/mdiskcopy
Copies a diskette to another diskette as a bit-image copy

/usr/ucb/mtools/mformat
Adds a DOS file system to a low-level formatted diskette

/usr/ucb/mtools/mkmanifest
Creates a shell script to restore UNIX file names from DOS file names

/usr/ucb/mtools/mlabel
Labels a DOS volume

/usr/ucb/mtools/mmd
Makes a DOS directory

/usr/ucb/mtools/mrd
Removes a DOS directory

/usr/ucb/mtools/mread
Performs a low level read (copy) of a DOS file to a UNIX-format file

/usr/ucb/mtools/mren
Renames an existing DOS file

/usr/ucb/mtools/mtype
Displays the contents of a DOS file

/usr/ucb/mtools/mwrite
Performs a low level write (copy) of a UNIX file to a DOS-format file

/usr/ucb/mtools/unix2dos
Converts a UNIX file to DOS format

DOS file names optionally are composed of a drive letter followed by a colon, a subdirectory, and a file name.  Subdirectory names can use either the slash (/) or backslash (\) characters as a separator.  The use of the backslash separator or wildcards requires the names to be enclosed in quotes to protect them from the shell. 

The regular expression “pattern matching” routines follow the UNIX rules.  For example, an asterisk (∗) matches all DOS files in place of asterisks separated by a dot (.) such as ∗.∗.  The archive, hidden, read-only, and system attribute bits are ignored during pattern matching. 

Not all UNIX file names are supported in the DOS world.  The mtools commands might have to change UNIX file names to fit the DOS file name conventions.  Most commands provide the verbose option (−v), that displays new file names if they have been changed. The following table shows some examples of file name conversions:

UNIX File Name DOS File Name Reason for the Change
thisisatest THISISAT File name too long
file.stuff FILE.STU File xtension too long
prn.txt XRN.TXT The string prn specifies a device name
.abc X.ABC Null file name
hot+cold HOTXCOLD Illegal character

All options use the minus (-) option, not the slash (/) as provided under DOS conventions. 

The mcd command is used to establish the device and the current working directory (relative to the DOS file system), otherwise the default is assumed to be A:\. 

All the mtools commands return 0 on success and 1 on complete failure. 

All mtools require a floppy diskette properly installed on the system. All mtools facilities address a device named /dev/disk/floppy. You must create a symbolic link between the diskette’s device special files and the file /dev/disk/floppy, depending on what type of diskette drive is on your system. See the EXAMPLES section for information on how you set up the diskette drive. 

RESTRICTIONS

If the proper device is not specified (when multiple disk capacities are supported) the device driver might display an error message. You can ignore this message. 

EXAMPLES

Device special file names are created automatically for all existing devices. If no device special file exists for the floppy drive, see dsfmgr(8).  Refer to hwmgr(8) for information on how you determine what kind of floppy drive is on your system, and to find its device name. 

     1.If the diskette drive is attached to the floppy disk interface (FDI) it has the device name floppyN, where N is an integer. Your /dev/disk directory must contain the following device special files for two floppy disk partitions:

       •/dev/disk/floppyNa

       •/dev/disk/floppyNc

Link the c partition to the file /dev/disk/floppy:

# ln -s /dev/disk/floppy0c /dev/disk/floppy

     2.If the diskette drive is a SCSI device, the device name has the format dskN, where N is an integer. Use the SysMan Station, or the hwmgr command to determine the device name. 

The following example sets up a SCSI floppy diskette for access by the mtools commands by linking the device to /dev/disk/floppy as follows:

# ln -s /dev/disk/dsk13c /dev/disk/floppy

     3.To test the configuration of a diskette drive, insert a DOS formatted disk and enter the following command:

# /usr/ucb/mtools/mdir
Volume in drive A is "volume_name."
Directory for A:/
file type size date time
file type size date time

SEE ALSO

Commands: dos2unix(1) ,dsfmgr(8), hwmgr(8), ln(1), mattrib(1), mcd(1), mcopy(1), mdel(1), mdir(1), mdiskcopy(1), mformat(1), mlabel(1), mmd(1), mrd(1), mread(1), mren(1), mtype(1), mwrite(1), sysman_station(8), unix2dos(1)

Floppy disk interface:  fd(7)

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026