COHERENT manpages

This page displays the COHERENT manpage for doscp [Copy files to/from an MS-DOS file system].

List of available manpages
Index


doscp -- Command

Copy files to/from an MS-DOS file system
doscp [-abkmrv] src dest

doscp copies  files between MS-DOS  and COHERENT file  systems.  The MS-DOS
file system can  reside either on a floppy disk,  or on an MS-DOS partition
of a hard disk.

src names the file being copied  and the file system where it resides; dest
names the  file system and  directory into which  the file is  copied.  The
operating system that owns the src  file is implied by the name of the file
system on which it resides.  An  MS-DOS file system must be named using the
device  that holds  it, such  as floppy-disk  drive /dev/fha0  or hard-disk
partition /dev/at0a. You  can also build a file of  aliases so that you can
access the  drives as  a, b,  etc.  For details,  see the  section entitled
Configuring the dos Commands, below.

doscp converts a file's name from one operating system's conventions to the
other's.  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, doscp 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, doscp 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, doscp  converts it to `_'.   doscp truncates the portion  of the file
name to the left of the `.' to a maximum of eight characters and portion to
the right of the `.' to a maximum of three characters.

doscp recognizes the following options:

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, doscp  performs ASCII  conversion on  files that have  an ASCII
   extention.  See Setup, below.

b  Do not perform any newline conversion on file transfers.

k  Keep: give  the copied  file the  same time stamp  as its  original.  By
   default, doscp gives copied files the current time.

m  Same as a, described above

r  Same as b, described above.

v  Verbose.  Provide additional information about each action performed.

Configuring the dos Commands

The dos family commands  read the file /etc/default/msdos before they begin
to interpret arguments.  By modifying this file, you can establish defaults
that let COHERENT's  dos commands resemble their counterparts under MS-DOS.
You can set up two classes of defaults: device defaults and file defaults.

A device default  lets you declare an alias for  a device that holds an MS-
DOS file system.  This device can  be a floppy-disk drive, a partition on a
hard disk, or an extended partition on a hard disk.  The alias must consist
of one or  two letters.  No letter can serve  as an alias for more than one
device.  For example, the following declaration:

    c=/dev/at0a

specifies that  the hard-disk partition accessed via  device /dev/at0a is a
``Primary MS-DOS'' partition, and that  its alias is c.  Hereafter, the dos
commands will interpret c as being equivalent to /dev/at0a.

The declaration

    d=/dev/at0b;1

specifies the first ``Extended MS-DOS'' partition on the partition accessed
via device  /dev/at0b. Bumping  the number  from 1 to  2 would  specify the
second extended MS-DOS partition within partition /dev/at0b, as in:

    e=/dev/at0b;2

Notice how the device names (c,  d, and e) can correspond to the same drive
names  as  under  MS-DOS, whether  or  not  they  are  primary or  extended
partitions.

File declarations, on the other hand,  simply declare that all files with a
given suffix are text files and should always have their newline characters
converted from  COHERENT to  MS-DOS format  (or vice versa).   For example,
placing the line

    .c

in /etc/default/msdos tells all of the dos commands that all files with the
suffix .c are text files and should have their newline characters converted
by   default.    You   can   have   any   number  of   file   defaults   in
/etc/default/msdos.

Examples

The first example copies all C  source files from floppy drive /dev/fva1 to
correspondingly named  files in  the current COHERENT  directory, preserves
the time stamp, and performs newline conversion upon them:

    doscp -akv /dev/fva1:source/\*.c .

Note that you  must quote wildcard characters with a  backslash to keep the
shell from interpreting them.   Also note that /dev/fva1 is a high-density,
3.5-inch  floppy disk  in floppy-disk  drive 1.  So,  if your  default file
contained the entry

    b=/dev/fva1
    .c

you could also have typed:

    doscp -kv b:source/\*.c .

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

    doscp /dev/at0a:autoexec.bat /tmp

If your /etc/default file contains the entry

    c=/dev/at0a

then you can also type:

    doscp c:autoexec.bat /tmp

Files

/etc/default/msdos -- Setup file

See Also

commands,
cp,
dos

Notes

For a discussion of the error message

    Probably not a DOS disk

see the  notes to  the Lexicon  entry for doscp.  doscp does not  check for
unusual characters  in a COHERENT file  name or for file  names that differ
from other file names only in case.

Beware of  using doscp to  create impossible files, e.g.,  com1. Such files
create  serious problems;  for example,  if  you try  to TYPE  or otherwise
perform MS-DOS operations on com1, you will attack the MS-DOS device driver
instead of the  file.  Be sure to rename all  such files when you copy them
from a COHERENT to an MS-DOS file system.

doscp  does  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 doscp.