How do I use the workstation floppy drive to read & write IBM DOS diskettes?

School of Statistics, University of Minnesota


Several of the HP workstations include floppy drives. These drives will read and write MS-DOS diskettes. There are many ways to make use of the drive, from the raw device level approach to some utilities that make life a lot easier, but won't do everything. This helpfile deals only with the latter option. In order to use these tools, you will have to add

/usr/local/bin/mtools

to your search path if you don't already have it set up. This will give you access to several commands including, but not restricted to:

mcd
mdir
mformat
...etc...

To see all the commands, simply ls /usr/local/bin/mtools. At this time there are no man pages available. If the workstation is properly set up, it will recognize drive A: as the floppy drive. If you have problems, please email below. The README file from the software installation gives a lot of additional details on how to use the utilities. It is recommended that you review these items as in addition to the different names (mdir vs. dir, etc.) there are also other issues related to DOS commands on Unix that require your attention (specifically, changes in standard procedure and the occasional need to include quotes around parts of your command string.)

The original supplemental documentation follows:




                                MTOOLS
                              version 3.9.5

Mtools is a public domain collection of programs to allow Unix systems
to read, write, and manipulate files on an MSDOS filesystem (typically a
diskette).

The following MSDOS commands are emulated:

Mtool           MSDOS
name            equivalent      Description
-----           ----            -----------
mattrib         ATTRIB          change MSDOS file attribute flags
mcd             CD              change MSDOS directory
mcopy           COPY            copy MSDOS files to/from Unix
mdel            DEL/ERASE       delete an MSDOS file
mdir            DIR             display an MSDOS directory
mformat         FORMAT          add MSDOS filesystem to a low-level format
mlabel          LABEL           make an MSDOS volume label.
mmd             MD/MKDIR        make an MSDOS subdirectory
mrd             RD/RMDIR        remove an MSDOS subdirectory
mread           COPY            low level read (copy) an MSDOS file to Unix
mren            REN/RENAME      rename an existing MSDOS file
mtype           TYPE            display contents of an MSDOS file
mwrite          COPY            low level write (copy) a Unix file to MSDOS

You should be able to just close your eyes and pretend you're on an MSDOS
system.  Everything should work the same... except for the added 'm' at
the beginning of each command.

I really wanted to avoid the use of a 'text' mode and a 'data' mode when
transferring files, but I couldn't find a better way.  It gets rather
confusing and it's quite possible to mess up a file if you apply the
text mode when it is not appropriate (ie:  to a COM or EXE file).

The pattern matching routine more closely resembles Unix than MSDOS.
For example, "*" matches all MSDOS files in lieu of "*.*".

The use of wildcards (or the '\' separator) will require the names to be
enclosed in quotes to protect them from the shell.  For example:

        RIGHT:  mcopy "a:*.c" .

        will copy all files on the A: disk with the extension .C to the
        current Unix directory.

        WRONG:  mcopy a:*.c .

        will cause the shell to expand a:*.c in the current Unix directory
        (which is probably not what you wanted) then copy that list of
        files (if there were any) from A: to the current Unix directory.

        RIGHT:  mcopy *.c a:

        will copy all files with the extension .c in the current Unix
        directory to the A: drive.  (This time you *want* the shell
        the expand the *.c).

The manuals are very terse...  it's assumed that the reader is already
familiar with MSDOS.

Mcopy is really a front-end to the low level Mread and Mwrite commands.



Last updated, Wednesday August 25, 1999 by mayotte@stat.umn.edu.