COHERENT manpages

This page displays the COHERENT manpage for dos [Manipulate files on MS-DOS file systems].

List of available manpages
Index


dos -- Command

Manipulate files on MS-DOS file systems
dos [-]dFflrtx[flags] [device] [file ...]

The  command dos  allows the  COHERENT  user to  manipulate an  MS-DOS file
system, which may be either a hard-disk partition or a floppy disk.  It can
build an empty MS-DOS file system, label it, list the files in it, transfer
files between it and COHERENT, or delete files from it.

The  given device  must be  a special  file that  specifies an  MS-DOS file
system,  such  as   floppy-disk  drive  /dev/fha0  or  hard-disk  partition
/dev/at0a.  The default  device is /dev/dos, which the system administrator
should link to the most commonly used device name.

dos converts  between the differing  file-name conventions of  COHERENT and
MS-DOS.  An MS-DOS  file argument may be specified in  lower or upper case,
using `/' as the  path-name separator.  When transferring files from MS-DOS
to COHERENT,  dos converts an MS-DOS  file name to a  COHERENT file name in
lower  case only.   If  the MS-DOS  file  name contains  no extension,  the
COHERENT file name contains  no `.'.  When transferring files from COHERENT
to MS-DOS,  dos converts all alphabetic characters in  a COHERENT file name
to upper  case; if a period  `.' appears at the beginning or  end of a file
name, dos  converts it  to `_'.   dos truncates the  part of the  file name
before the  last `.'  to a  maximum of eight  characters and  truncates the
extension to a maximum of three characters.

The command line must specify exactly one of the following functions.

d    Delete each file from the MS-DOS file system.  This option also allows
     the user to delete empty directories.

F    Create  an empty  MS-DOS file  system on  a formatted  diskette.  This
     option is  analogous to the  COHERENT command /etc/mkfs.  The COHERENT
     commands /etc/fdformat and /etc/mkfs initialize a COHERENT diskette in
     two steps.   The MS-DOS command format  initializes an MS-DOS diskette
     by performing both the physical and logical formatting operations with
     one command.  To initialize an MS-DOS diskette under COHERENT, use the
     command  /etc/fdformat -v  devicename, followed by  the command  dos F
     devicename.  If file is named, dos  copies it to the boot block of the
     file system.   The dos command cannot  build a file system  on a hard-
     disk partition.

f    Force removal of readonly files on the MS-DOS side.

l    Label the  MS-DOS file system.  The command  line must specify exactly
     one file argument, which gives the label.

r    Replace each file on the MS-DOS  file system with the COHERENT file of
     the  same  name.   If  a  given  file argument  specifies  a  COHERENT
     directory, dos  replaces its subdirectories recursively  to the MS-DOS
     file system unless  the s flag is used.  If  no file is specified, dos
     copies all files in the current directory to the MS-DOS file system.

t    List the  files on  the MS-DOS  file system.  If  no file  argument is
     given, dos  lists the entire  MS-DOS file system;  otherwise, it lists
     each file.   If a file argument specifies  an MS-DOS subdirectory, dos
     lists  its  contents.  dos  lists  directories  first in  alphabetical
     order, then ordinary files in alphabetical order.

x    Extract each  file from the MS-DOS  file system to a  COHERENT file of
     the  same  name.   If  a  given  file  argument  specifies  an  MS-DOS
     subdirectory, dos extracts  its contents recursively unless the s flag
     is used.  If no file is  given, dos extracts all files from the MS-DOS
     file system to the current COHERENT directory.

The following flags are available.

a    Perform ASCII newline  conversion on file transfer.  When moving files
     from COHERENT  to MS-DOS, this  option converts each  COHERENT newline
     character `\n' (ASCII LF) to  an MS-DOS end-of-line (ASCII CR and LF);
     when moving  files from MS-DOS to COHERENT, it  does the opposite.  By
     default,   dos  performs   binary  file   transfer,   without  newline
     conversion.

k    Keep  the  file  modification  time  (mtime)  on extract  and  replace
     operations.   By default,  dos gives extracted  or replaced  files the
     current time.   With this option, dos gives  the extracted or replaced
     file the same time as the original file.

n    List  files in  order of  creation (newest file  last) rather  than in
     alphabetical order.  This option applies only to the table-of-contents
     function.  dos always  lists directories before files, with or without
     the n option.

p    Perform  a  piped extract  or  replace (for  use  in pipelines).   The
     command line must specify exactly one file argument.  For extract, dos
     reads  the given  file  and writes  it  to the  standard output.   For
     replace, dos reads the standard input and writes it to the given file.

s    Suppress extraction or replacement of subdirectories.  By default, dos
     extracts or replaces subdirectories recursively.

v    Verbose  option.  Provide additional  information about  each function
     performed.

[1-9]
     A  digit  specifies  a logical  drive  number  on  an extended  MS-DOS
     partition.  For example, dos  tv2 /dev/at0c lists the directory of the
     second logical drive on extended MS-DOS partition /dev/at0c.

dos Commands

dos  is  an  obsolete command.   It  has  largely  been  superceded by  the
following family of COHERENT commands that manipulate MS-DOS file systems:

doscat  Concatenate a file on an MS-DOS file system.
doscp   Copy files to/from an MS-DOS file system
doscpdir
        Copy a directory to/from an MS-DOS file system
dosdel  Delete a file from an MS-DOS file system
dosdir  List contents of an MS-DOS directory
dosformat
        Build an MS-DOS file system on a floppy disk
doslabel
        Label an MS-DOS floppy disk
dosls   List files on an MS-DOS file system
dosmkdir
        Create a directory in an MS-DOS file system
dosrm   Remove a file from an MS-DOS file system
dosrmdir
        Remove a directory from an MS-DOS file system

For details, see these commands' entries within the Lexicon.

Examples

The  first example  copies  all files  located in  directories sources  and
include,  as well  as any  subdirectories, from  floppy drive  /dev/fva1 to
correspondingly named subdirectories in the current COHERENT directory:

    dos xavk /dev/fva1 sources include

Note that fva1 is a high-density, 3.5-inch floppy disk in floppy-disk drive
1  (a.k.a.,  drive  B:).  The  files  will  be  copied  with ASCII  newline
conversion and will retain the time and date that they had under MS-DOS.

The next example copies a file  from an MS-DOS partition on your hard disk.
Suppose that C:  is the primary MS-DOS partition on  your first hard drive.
The following command  copies file C:\AUTOEXEC.BAT to /autoexec.bat in your
COHERENT root partition:

    dos xa /dev/at0a /autoexec.bat

You will  want to  use the a  switch any time  you are transferring  a text
file.

Suppose that the second partition on your first hard drive (COHERENT device
/dev/at0b) is an extended MS-DOS  partition with two logical drives, D: and
E:. To copy a COHERENT text file /tmp/foo to D:\TMP\FOO, use the command

    dos ra1 /dev/at0b /tmp/foo

To copy  non-text file  frotz in the  current COHERENT directory  to MS-DOS
file E:\DBF\AX\FROTZ, use the command

    dos rp2 /dev/at0b dbf/ax/frotz < frotz

See Also

commands,
fdformat,
mkfs,
MS-DOS

Notes

dos is  an obsolete command.   It has been retained  for compatibility with
earlier versions of COHERENT.  We urge  you to use the other members in the
dos family of commands, which have  a cleaner syntax and are much easier to
use.

dos does  not check for unusual  characters in a COHERENT  file name or for
file names that differ from other file names only in case.

The dos  family of commands now  support large file systems,  such as those
created by MS-DOS versions 4.0 and 5.0.

The COHERENT  system's dos family of commands  do not understand compressed
MS-DOS  file systems  created by  programs  such as  Stacker or  MS-DOS 6.0
dblspace. If  you are running  MS-DOS with file compression,  you must copy
files  to an  uncompressed  file system  (for example,  to an  uncompressed
floppy disk  or to the uncompressed  host for a compressed  file system) to
make them accessible to the COHERENT dos commands.