MOVE <source filespec> <-fs> [/option] <dest dirspec> <-fs> [/option] |
The MOVE command copies files between DOS PLUS and BBC filing systems. It is intended primarily for saving DOS PLUS files on ANFS or ADFS but some support is provided for other filing systems (i.e. DFS). In this document the DOS PLUS operating system will be referred to as DOS and BBC filing systems (ANFS and ADFS) will be referred to as MOS filing systems. Files that have been originally saved under DOS PLUS i.e. utilities such as DISK.CMD, COLOUR.EXE or text files such as LETTER.DOC are referred to as DOS PLUS files and files that have been originally saved under ANFS or ADFS i.e. BBC BASIC files or VIEW documents are referred to as MOS files. The MOVE utility enables DOS PLUS files to be transferred from DOS to MOS and then copied back from MOS to DOS with the original filename, filetype and attributes preserved. MOS files can be copied to DOS but the filename may be truncated and file attributes will not be saved.
The <source filespec> can be used to specify a single file or multiple files using the wild card characters * and ? for DOS and * and # for MOS. The source files can be specified using any valid DOS or MOS pathname. MOVE does not recognise passwords in DOS file specifications – if files are password protected a default password must be set.
The <dest dirspec> is used to identify the destination directory which can be specified using any valid DOS or MOS pathname. The special character @ is used to indicate the currently selected destination directory for both DOS and MOS operations. (NOTE – as @ is a valid filename character under DOS it should not be used as a directory name as a conflict will occur). The /r option can be used in a destination specification to allow single files to be copied to the given filename rather than being copied with the same name to the given directory.
The <-fs> field is used to indicate the source or destination filing system as follows -
Filing system | <-fs> |
DOS PLUS | -dos |
ADFS | -adfs |
ANFS | -net |
DFS | -disc |
The [/option] field specifies the following optional parameters
Option | Description |
/C | Only valid for MOS source filespec – allows filetype subdirectories to be copied from MOS to MOS (Default for MOS to MOS copy is to ignore FSD's) |
/I | Only valid for MOS source filespec – specifies that filetype subdirectories should be ignored. It is only needed in MOS to DOS copies as it is the default setting for MOS to MOS copies. It allows DOS files with no extension to be copied from MOS. |
/S | Only valid for source files. It is used to copy DOS system files. |
/R | Only valid for destination files and single file copies. It is used to specify a destination filename instead of a directory name. |
A>MOVE SDIR.CMD -DOS :1.$.DOSPLUS -ADFS
This copies the file SDIR.CMD from the current directory on DOS drive A to the directory :1.$.DOSPLUS on ADFS drive 1.
This section explains how to copy a group of files from DOS to a MOS filing system (ANFS in this example) and then how to copy them back to DOS. It is assumed that the user has already logged on to the network by some means (i.e. the STAR utility), has created a directory called DOSPLUS in the Users Root Directory (URD), and it is the Currently Selected Directory (CSD). (See ANFS documentation for explanation of URD, CSD) It is not absolutely necessary to create a separate directory for DOS files but it is STRONGLY RECOMMENDED as mixing DOS and MOS files in the same directory will probably cause confusion and may cause MOS files to be copied unnecessarily during MOS to DOS transfers.
The following command will copy all the files from DOS drive B with the BAT extension to the CSD on ANFS (i.e. DOSPLUS) (NOTE – the A> prompt should not be typed in the following examples – it is included to indicate the current DOS drive)
A>MOVE B:*.BAT -DOS @ -NET
To copy the files back from ANFS to the CSD on DOS drive A type
A>MOVE BAT.* -NET @ -DOS
NOTE that the source specification for the ANFS files reverses the filetype and filename of the DOS file specification. This is necessary because of the way that DOS files are stored under ANFS or ADFS (See later section)
To copy all the files from subdirectory GEM on DOS drive A to the same directory on ANFS use
A>MOVE \GEM\*.* -DOS @ -NET
To copy all the files back from ANFS to DOS directory GEMBAK on drive B type
A>MOVE * -NET B:\GEMBAK -DOS
NOTE that for the ANFS source specification * is equivalent to the DOS *.* and copies all the files from the current directory.
The above example shows how to copy files from DOS to a single MOS directory i.e. all the files were being copied to the same ANFS directory. This method is adequate if the source DOS disk does not contain any DOS Subdirectories (DSD's) or if only a small number of files are to be copied. However if the source DOS disk contains several subdirectories (which may themselves contain further subdirectories) then copying all the files to the same ANFS directory would result in loss of the DOS directory structure. To allow DSD's to be created in a MOS directory the special character \ is used as the first character of the DSD name. This is necessary because of the way that DOS files are stored in MOS filing systems. DOS files that have no filetype extension i.e. INVOICE are stored in the specified destination directory. Files that have a filetype extension i.e. LETTER.BAK are stored in a directory BAK with the name LETTER. The filetype subdirectory (FSD) is automatically created if not already present. Similarly the file VDU.EXE would be stored in a FSD called EXE with name VDU. As DOS filetype extensions can be no longer than 3 characters any subdirectories with a name longer than 3 characters will be ignored in a MOS to DOS file copy. This provides another means of distinguishing between DSD's and FSD's in the same MOS directory i.e. if the DSD name is longer than 3 characters it will not be mistaken for a filetype subdirectory. The following diagram illustrates the mapping between a DOS directory structure and an equivalent MOS directory structure.
DOS | MOS |
(toucan.exe) --- a:\ --- (koala) /\ / \ / \ / \ / \ lc docns -- (invoice) /\ /\ / \ / \ / \ / (letter.bak) (vdu.exe) h (order.txt) /\ / \ / \ / \ (mos.lib) (stdio.lib) |
$.eric | | exe -- dosplus -- (koala) | /\ (toucan) / \ / \ / \ \lc \docns -- invoice /\ /\ / \ / \ / \ / \ exe \h txt bak | | | | (vdu) | (order)(letter) | lib /\ / \ / \ (mos) (stdio) |
where objects enclosed in () are files,objects not enclosed in () are directories
The above example shows how files would be copied from DOS drive A: to an ANFS directory $.eric.dosplus i.e. to directory DOSPLUS in user ERIC on the network. It is important to note that the DOS Root Directory (DRD) DOSPLUS and DOS subdirectories \LC, \DOCNS etc are not automatically created by the MOVE utility i.e. MOVE does not copy a whole directory tree. It is the users responsibilty to create the DRD's and DSD's when they are required. This is directly analogous to using the DOS PLUS COPY command which copies files between directories but requires the destination directory to be already present.
The character \ is used above to indicate DOS subdirectories in a MOS directory rather than use names of 4 or more characters. Either method could be used interchangeably but it is better to just choose the one method that suits you and use it consistently.
The actual commands required to perform the above MOVE operation are now given as an example. It is assumed that the following MOS * commands have already been given to prepare for the copy and ERIC is already a user on the NET.
*net
*i am eric log on to net
*cdir dosplus create
DOS Root Directory
*cdir dosplus.\lc create DOS SubDirectories
*cdir dosplus.\lc.\h
*cdir dosplus.\docns
Copy all files in root on DOS drive A:
A>MOVE A:\*.* -DOS DOSPLUS -NET
Copy all files in A:\DOCNS
A>MOVE A:\DOCNS\*.* -DOS DOSPLUS.\DOCNS -NET
Copy all files in A:\LC
A>MOVE A:\LC\*.* -DOS DOSPLUS.\LC -NET
Copy all files with type LIB in A.\LC\H
A>MOVE A:\LC\H\*.LIB -DOS DOSPLUS.\LC.\H -NET
The commands required for the inverse operation (i.e. copying from the NET to a DOS disk in drive B:) are now given. It is assumed that the following DOS PLUS commands have been given to prepare the destination disk for the copy.
MD B:\LC
MD B:\LC\H
MD B:\DOCNS
Copy all files from DOS Root Directory
A>MOVE &.DOSPLUS.* -NET B:\ -DOS
Copy all files from DOS SubDirectory \DOCNS
A>MOVE &.DOSPLUS.\DOCNS.* -NET B:\DOCNS -DOS
Copy all files from DOS SubDirectory \LC
A>MOVE &.DOSPLUS.\LC.* -NET B:\LC -DOS
Copy all files with type LIB from DOS SubDirectory \H
A>MOVE &.DOSPLUS.\LC.\H.LIB.* -NET B:\LC\H -DOS
NOTE – when copying from ANFS the source directory must be referred to the URD using the & character because the Currently Selected Directory on ANFS cannot be restored after the MOVE operation.
In addition to copying files between DOS and MOS, files can also be copied directly from MOS to MOS using either two different filing systems or the same filing system as source and destination. When copying files between MOS filing systems MOVE will only copy files from the specified directory and will not search any filetype subdirectories unless the /C option is supplied. The default operation provides the same type of copy as performed by the ADFS and DFS *COPY command or MOS *MOVE command and is therefore suitable for copying MOS files (i.e. BBC BASIC programs or VIEW text files). It is also possible to copy a MOS directory that contains DOS files and DOS filetype subdirectories by specifying the /C option in the source filespec. This type of operation is most suitable for copying DOS files that have been saved to MOS by a previous MOVE command.
As an example the DOS files copied to the NET directory DOSPLUS in the previous section could be copied to an ADFS directory $.DOSPLUS on drive 1. The ADFS disc must first be prepared for the copy by issuing the following * commands
*adfs
*dir :1
*cdir dosplus
*cdir dosplus.\lc
*cdir dosplus.\lc.\h
*cdir dosplus.\docns
and then giving the following MOVE commands
A>MOVE &.DOSPLUS.* -NET /C :1.$.DOSPLUS -ADFS
A>MOVE &.DOSPLUS.\DOCNS.* -NET /C :1.$.DOSPLUS.\DOCNS -ADFS
A>MOVE &.DOSPLUS.\LC.* -NET /C :1.$.DOSPLUS.\LC -ADFS
A>MOVE &.DOSPLUS.\LC.\H.LIB.* -NET /C :1.$.DOSPLUS.\LC.\H -ADFS
If user ERIC on the NET also has directories $.ERIC.BASIC and $.ERIC.VIEW which contain BBC BASIC files and VIEW text files respectively then these can be copied to the same ADFS disc (assuming directories :1.$.BASIC and :1.$.VIEW are present) using these two MOVE commands
A>MOVE &.BASIC.* -NET :1.$.BASIC -ADFS
A>MOVE &.VIEW.* -NET :1.$.VIEW -ADFS
In the examples given so far a group of files has been specified by the * wild card character which matches all the files in the source directory for both DOS and MOS files. It is also possible to specify that only certain files that match a given pattern of characters will be copied using combinations of the wildcard characters *, ? and #. The wildcard characters have different meanings dependent on the source filing system as given by the following table.
Filing System | Wildcard | No. Characters Matched |
DOS | * | 0 - 8 |
DOS | ? | 0 - 1 |
MOS | * | 0 - 10 |
MOS | # | 1 |
There are certain differences between the use of wildcards for DOS and MOS filing systems which should be noted. To illustrate this consider the following DOS files that have been copied to a MOS filing system.
A.BAT AA.BAT AB.BAT ABC.BAT TEXT1B.DOC TEXT2B.DOC TESTB.DOC
These files will be saved under MOS with the following names
BAT.A BAT.AA BAT.AB BAT.ABC DOC.TEXT1B DOC.TEXT2B DOC.TESTB
The following table shows the files matched by the given DOS and MOS wildcard specs
Filing System | Wildcard | Files Matched |
DOS | *.* | all 7 DOS files |
DOS | A*.BAT | A.BAT AA.BAT AB.BAT ABC.BAT |
DOS | A?.BAT | A.BAT AA.BAT AB.BAT |
DOS | TE?T?B.DOC | TEXT1 B.DOC TEXT2B.DOC TESTB.DOC |
MOS | * | all 7 MOS files |
MOS | BAT.A* | BAT.A BAT.AA BAT.AB BAT.ABC |
MOS | BAT.A# | BAT.AA BAT.AB |
MOS | DOC.TE#T#B | DOC.TEXT1B DOC.TEXT2B |
MOS | BAT.*A | BAT.A BAT.AA |
MOS | DOC.T*B | DOC.TEXT1B DOC.TEXT2B DOC.TESTB |
MOS | DOC.T*X*B | DOC.TEXT1B DOC.TEXT2B |
From the table it can be seen that ? and # behave differently because ? will match 0 or 1 characters but # will match 1 character only. The * character functions identically for DOS and MOS if it is used as the last character of the filename or filetype. When using MOS wildcard specs the * character does not have to be the last character of the filename or filetype hence it is possible to use patterns such as *A (all files ending in A) and T*B (all files starting with T and ending with B). These patterns are illegal under DOS and will give an error message if used. Care must therefore be taken when copying back from MOS to DOS to ensure that the wildcard spec will copy all the required files. If in doubt about whether all the required files will be copied it is best to use a pattern which will copy more files than required (i.e. A* not A#) and then delete any files not required.
NOTE – Wildcard filespecs can be used only on MOS filing systems that support the OSGBPB function with A = 8 (Read names from current directory). This includes DFS , ADFS , NFS and ANFS but NOT CFS or RFS. For CFS and RFS filespecs must specify a single file only (i.e. contain no wildcard characters)
When copying from DOS to MOS the destination filename is formed from the filename and filetype of the source DOS file. In a few special cases this can produce a destination filename which contains invalid characters and therefore cannot be saved to the MOS filing system. To overcome this problem the invalid characters are translated to valid MOS characters to allow the file to be saved. When the file is subsequently copied back from MOS to DOS the invalid characters are translated back again to restore the file's original name. The following table shows the character translation used.
DOS character | MOS character | ||
# | ? | ||
$ | £ | ||
& | { | ||
- | + | ||
@ | = |
The corresponding MOS characters have been chosen to ensure that no conflict will occur with other non alphanumeric DOS characters that do not require translation (see below)
When copying MOS files from MOS to DOS (i.e. VIEW text file) the following additional non alphanumeric characters are invalid under DOS and are translated to the underline character _.
! \ { } [ ] ; / < >
The following non alphanumeric characters are valid under both MOS and DOS.
% ' ( ) _ ~