 
7.Reading, Writing, and Manipulating DOS
files under Linux
mtools
is a set of programs
that allow Linux
systems to read,
write, and manipulate files on an MS-DOS
file system (usually
a diskette). Some of the available tools include:
|
mcopy |
to copy files
to/from DOS |
|
mdel |
to delete a DOS
file |
|
mdir |
to list files on
a DOS
diskette |
|
mformat |
to format a
diskette for DOS
use |
for example, to list
all files on a DOS
diskette in drive A:
mdir a:
¤
Notes:
* ‘a:’
represents the floppy drive on the Linux
systems in the
Linux lab.
* if the above
command displays an error message complaining about a bad FAT, then you
may need to issue an mformat before using the diskette.
Warning: this will format the disk, deleting any currently stored
files.
To copy the file
‘myprog.pas’ from a DOS
diskette to your
Linux
account:
mcopy a:myprog.pas
Wildcards
are also allowed. To
copy all your C files from a DOS
diskette to your
account:
mcopy a:\*.c
¤
Notes:
If one of the files
on the diskette already exists on your account, then you’ll be warned
about this, and prompted for an action which may be one of the
following:
·
‘o’
à
to overwrite the old file with the new one,
·
‘r’
à
to rename the new file, you’ll be asked for the new name,
·
‘s’
à
‘skip’ this particular file (don’t copy it).
You can also copy any
file from your account to the DOS
diskette:
mcopy myfile.doc a:
If the DOS
diskette has problems in its ‘FAT’ table, you may need to format it
before use, however, please beware that formatting will erase all files on
the diskette:
mformat a:
That’s not all what
‘mtools
’ has to offer, for
additional information about the rest of the ‘mtools’ programs and their
available options, summon the on-line help: man
mtools.
"
URL
:
Also you can get
on-line help on mtools by checking the following site:
http://www.ccis.ksu.edu.sa/cgi-bin/man2html
|