10: The MOVE Utility

Introduction

The MOVE command is an EXE file provided on Issue Disc One of DOS Plus (version 2.1 only). Although they are also still included in the version 2.1 issue, both GETFILE and PUTFILE are superseded by MOVE, which combines the functions of both, plus additional facilities, into one comprehensive utility. Also, MOVE is more robust than the two separate utilities, which are unreliable unless they are the Issue 2.1 version used from hard disc. MOVE's predecessors also had difficulty copying non-ASCII data files. It is recommended that they should not be used if you have MOVE.

MOVE can be used to copy files between any of several BBC filing Systems. As it is a DOS program, MOVE is provided for the obvious purpose of transferring files between the DOS disc and native BBC filing systems. It is also capable of copying data between any two files, either on the same or different discs, in the same or different filing systems. Neither the source nor the destination file need to be in DOS format. It is, therefore, perfectly possible to copy a file from one DES disc to another using MOVE, without leaving DOS.

The motivation for a more comprehensive file copying utility was the need to transfer data between DOS Plus and network systems, since Econet support is now available for DOS Plus. Fortunately Acorn have also included support for both DFS and ADFS. As the majority of use is expected to involve copies to or from DOS, greater attention is given to this type of operation, but examples of other copying operations are also included.

Operation

In the explanations DOS Plus will be referred to as DOS, and DOS disc files will be referred to as DOS files. Native disc filing systems and their files are referred to or prefixed by their usual synonyms, i.e. DFS, ADFS or NFS, or referred to collectively as native BBC or MOS formats. The abbreviation FS means any type of filing system.

When either the source or destination file is to be DOS, the precise format specification (e.g. 360k, 640k, 720k or 800k) is irrelevant. If the 512 can normally read and/or write the disc in question, MOVE will process the files as required without special instructions.

MOVE enables DOS PLUS files to be transferred from DOS to BBC filing systems and subsequently copied back to DOS with the original filename, filetype and attributes preserved. Original BBC FF files can be copied to DOS, but the filename may be truncated and BBC FS file attributes will not be saved.

Note that because the MOVE utility is a one-shot transient (i.e. it cannot be semi-permanently invoked with a command line, like STAR or PIP), unless retrieved via the current PATH setting or by supplying an explicit pathname when calling the command, it must be present in the current directory on the current drive. The corollary to this is that, for two disc systems, the copy must always be to (and) or from DOS.

For two disc Systems, where the copy does not involve DOS either as source or destination filing system, the solution is to set up a memory disc, copy MOVE .EXE to it and then select the M: as the current drive. Other BBC FS copies can then be performed between the two floppy drives. You should also copy COMMAND.COM to the memory disc to minimise the risk of being forced to re-boot in the event of an unexpected error corrupting memory.

In its simplest form the MOVE command may be issued without parameters, when a brief help prompt will be displayed as below:

MOVE version 0.66
syntax: move <source filespec> <-fs> [lopt] <dest filespec > <-fs> [(opt]

where:

<source filespec> is the name of the Source file or directory
<dest dirspec> is the name of the destination file or directory
<-fs> is the type of filing system applicable to each disc
[/opt] is an option parameter farther qualifying the operation

Command Parameters and Syntax

Source File Specification

The <source filespec> indicates that a source file specification should be supplied. Either a single file, or multiple files using the wild card characters * and ? for DOS and * and # for BBC native files, may be used when files are not being renamed during the copy. The source file specification can include any valid DOS or RISC FS pathname, though for DOS files (Source or destination) the current drive and directory will be used by default as normal if no explicit path is specified.

Wherever a drive is specified the normal conventions apply. That is, DOS drive A: equates to ADFS drive 0 or DFS drives 0 and 2, DOS drive B: equates to ADFS drive 1 or DFS drives 1 and 3. MOVE does not recognise passwords in DOS Plus or CP/M file specifications. If files are password protected a default password must be set.

Destination Directory Specification

The <dest dirspec> is used to identify the destination. If multiple files or a single file is being copied without a name change during the copy, this will be a directory name alone, which can include any valid pathname. If a single file is to be renamed during the copy the new filename should be supplied as part of the specification. (See examples using the /r option).

Even if a file is not to be renamed, it is a more reliable technique to use the /r option to qualify the destination specification. This instructs the (single) source file to be copied to a fully named destination, rather than copying to a directory and allowing MOVE to set the filename by default with, occasionally unanticipated character substitutions.

As usual with both DOS and BBC FS copy operations, if the destination file name does not exist it will be created by the copy. If the file does already exist it will be overwritten, provided that it is not locked in ADFS and DOS, or set to read-only in DOS or NFS. If an attempt is made to overwrite a locked BBC FS file MOVE displays an error in the form:

copying <source name> as <destination name>
MOS error: File locked

The equivalent DOS message for a read only file is Access denied

For all MOVE operations, if a destination directory is specified (which effectively applies to DOS, ADFS or ANFS only) that directory must already exist on the destination disc. Just as in DOS and ADFS when you can only copy to existing directories, so it is with MOVE.

Note that MOVE permits the special native BBC FS character 'if to be used to mean 'the currently selected destination directory', but accepts it for either DOS or native BBC FS transfer operations. You should remember that @ is a valid character in DOS filenames, therefore its use should be avoided as far as possible. (See 'filename Syntax' page 23 in the Dabs Press Master 512 User Guide). In the context of MOVE, using @ as a DOS destination directory name causes a logical impasse. Should MOVE use the current directory, or one literally called '@'?

<-fs>

The <-fs> field is a mandatory parameter, which is used to specify both the source and destination filing systems. The possible value for each entry is as follows:

Filing system <-fs> entry Meaning
DOS Plus -dos Any DOS Plus disc format
ADFS -adfs Acorn Advanced Disc ~
ANFS -net Acorn Network rs
DFS -disc Acorn Disc Filing System

Note that some DFS discs may have been formatted by an 8271 FDC. The use of such discs is limited to those of a standard format which can normally be read and written correctly by the WD1770/1772 FDC when used in DFS.

[/option]

The [/option] field is not mandatory, but it can be used to modify the copy operation. When used it can specify one of the following modifier actions for source or destination files. In the following explanations directory means any directory except the root.

In the explanations the meaning of the option is also supplied, but this is simply as an aid to memory. When entered as part of a command the option is always entered after the filing system and in the exact form shown, including the '/'.

Opt Meaning
/C Copy directory This is only valid for native BBC FS source specifications. It specifies that directories are to be copied from source to destination. The default for BBC to BBC copy operations without this option is to ignore the directories, copying only the files.
/L Ignore directory This is valid only for native BEC FS source specifications. It specifies that directories should be ignored. It is only required when native BBC files are copied to DOS, as it is the default for BBC to BBC copies. It allows DOS files with no extension to be copied from BBC FS discs when individual filenames are not supplied.
/S SYS: This valid only for use with a DOS Source file specification. It is used to copy DOS system files, that is, those with the /s attribute set which do not appear on directory listings unless requested, (eg. 6502.SYS).
/R Rename : This applies only to destination files and is used when a single file is to be copied, which must be the case if renaming is to take place. It specifies that a destination file has been specified, rather than a directory. Note that the destination specification in this case can use the same filename as the source, or it may be renamed as part of the copying operation The destination filename can also include any legal pathname, therefore a destination directory may still be specified.

Single File Moves

The command

MOVE WORDPROC.TXT -DOS :1.$.DOSTEXT -ADFS

copies the DOS file called WORDPROC.TXT from the current directory in the current drive (A:, C: or the memory disc) to the directory DOSTEXT on ADFS drive 1, using the original filename for the destination file.

MOVE B:*.TXT -DOS :0.$.DOSTEXT -ADFS

copies all the DOS files with a .TXT extension from the current directory of drive B: to the directory DOSTEXT on ADFS drive 0, using the original filenames for the destination files. When the command is used in this type of operation note that it is essential to ensure that there is sufficient space on the destination disc for all the files, and enough unused filename entries in the chosen directory.

MOVE WORDPROC.TXT -DOS :0.$.WRDPROC -Disc /r

copies the DOS file called WORDPROC.TXT from the current directory in the current drive (B:, C: or the memory disc) to the root directory on DFS drive 0, using the new filename WRDPROC for the destination file.

The command

MOVE :1.$.DOSTEXT.WORDPROC -ADFS :0.D.DOCUMNT -Disc /R

copies the file called WORDPROC from the directory DOSTEXT in the ADFS disc in drive 1 to the file called D DOCUMNT on the DFS disc in drive 0. Note that, in this example, the current DOS drive can be only a Winchester or the Memory Disc, and MOVE must be present on that drive, as both floppies are being used for native BBC FS formats.

MOVE 0:$.TEXT.* -ADFS :1.$.TEXTBAK -ADFS

copies all the files from the directory TEXT on the ADFS disc in drive 0 to the directory called TEXTBAK on the ADFS disc in drive 1, using the source filenames for each of the destination files. When the command is used in this type of operation it is essential to ensure that there is sufficient room on the destination disc, and enough unused filename entries in the chosen directory.

MOVE :1.WORDPROC -DISC :1.DOCUMNT -Disc /R

copies the file called WORDPROC, in the root directory on the DFS disc in drive 1 to the file called DOCUMNT, also in the root directory of the same DFS disc in drive 1.

Multiple Copies between DOS and MOS

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 (e.g. the STAR utility), has created a directory called DOSPLUS in the User's Root Directory (URD), and that 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 probably will at least, cause confusion and may also cause MOS files to be copied unnecessarily during MOS to DOS transfers.

The following command will copy all the files with the BAT extension from DOS drive B: to the CSD on ANFS (i.e. DOSPLUS):

MOVE B:*.BAT -DOS @ -NET

To copy the files back from ANFS to the CSD on DOS type:

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 MOS filenames cannot have a filename extension (see later).

To copy all the files from subdirectory GEM in DOS to the same directory in ANFS use:

MOVE \GEM\*.* -DOS @ -NET

To copy all the files back from ANFS to DOS directory GEMBAK. In drive B: the command would be:

MOVE -NET B: \GEMBAK -DOS

Note that, for the ANFS source specification, '*', is equivalent to the DOS '*.*' global wildcard specification and copies all files from the source directory.

Copying Whole Directories

The example above shows how to copy files from DOS to a single MOS directory as all the files were being copied to the same directory. This method is adequate if the source DOS disc does not contain any DOS sub-directories (DSDs), or if only a small number of files are to be copied. However, if the DOS source disc contains several subdirectories (which may themselves contain further subdirectories), then copying all the files to the same MOS directory would result in loss of the DOS directory structure.

To allow DSDs 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 e.g. TEXTFILE, are stored in the specified destination directory. Files that have a filetype extension e.g. LETTER.BAK are stored in a directory called BAK with the filename LETTER. Similarly, the file VDU.EXE would be stored in an FSD called EXE using the filename VDU.

An appropriate filetype subdirectory (FSD) is automatically created if it does not already exist.

As DOS filetype extensions are a maximum of three characters, any subdirectories with a name longer than three characters is ignored in a MOS to DOS file copy. This provides an ideal technique for distinguishing between DSDs and FSDS in the same MOS directory. If a DSD name is longer than three 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 when whole directory copying has been employed and all DOS directories were copied to a directory called DOSPLUS in the User's Root Directory (URD). ANFS is used for the following examples.

DOS To MOS Directory Mapping

;7\j;kaa1a} (LOUcafl~?;l;;P;us~ck~la
docns-- invoice
/r.tYter.tak
ens--invoice
(vdu.exe} h (orde
exe r} (letter)
ba\
(vdu)
(nns.lib} (stdio.lib)
'lb
I\.
mes staic)
MOS DOS
toucan.exe) --a:\ ---(koala) $.eric
lc docs -- (invoice) exe
{toucan}
dosplus koala  
{vdu.exe} h (order.txt) {letter.bak}          
  (MOS.LIB) (STDIO.LIB)            
               
               
               

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. That is, to directory DOSPLUS in user ERIC on the network.

It is important to note that the DOS Root Directory (DRD), DOSPLUS and the DOS sub-directories \tc, \DOCNS etc are not automatically created by the MOVE utility, i.e., MOVE does not copy a whole directory tree. It is the user's responsibility to create the URDs and DSDs 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 exist already.

The character '\' is used above to indicate DOS subdirectories in a MOS directory, rather than using names of four or more characters. Either method can be used at your discretion. Whichever is chosen, it is good practice to decide on a method and to remain consistent thereafter.

The commands required to perform the above MOVE operation are now shown. It is assumed that the following MOS * commands are issued to prepare for the copy and that ERIC is already an authorised user of the network. The preparatory MOS commands are:

*net
+I am eric		Log on to net
*cdir dosplus		(create DOS Root Directory)
*cdir dosplus.\lc	(create DOS Subdirectories)
*cdir dosplus.\le.\h	"   "     "   "  "     "
*cdir dosplus.\docns	"   "     "   "  "     "

The four required MOVE commands are:

1. Copy all files in the root directory in DOS drive A: to directory DOSPLUS in ANFS.

MOVE A:\*.* -DOS DOSPLUS -NET

2. Copy all files in directory A.\DOCNS to directory DOSPLUS - \DOCNS in ANFS.

MOVE A:\DOCNS\*.* -DOS DOSPLUS.\DOCNS -NET

3. Copy all files in directory A:\LC to directory DOSPLUS \LC in ANFS

MlOVE A:\LC\*.* -DOS DOSPLUS.\LC -NET

4. Copy all files with type LIB in directory A:\LC\H to directory DOSPLUS.\Lc.\H in ANFS.

MOVE A:\LC\H\*.LIB DOS DOS?LUS.\LC.\n -NET

The commands required for the reverse operation, copying from the NET to a DOS disc this time in drive B:, are now given. It is assumed that the following DOS PLUS commands have been given to prepare the directories on the destination disc for the copy.

MD B:\LC
MD B:\LC\H
MD B:\DOCNS

1. Copy all files from ANFS directory DOSPLUS to the DOS Root directory in drive B:.

MOVE &.DOSPLUS.* -NET B:\ -DOS

2 Copy all files from ANFS DOS sub-directory DOSPLUS\DOCNS to DOS directory \DOCNS in drive B:

MOVE &.DOSPLUS.\DOCNS.* -NET B:\DOCMS -Dos

3. Copy all files from ANFS DOS subdirectory DOSPLUS\LC to DOS directory \LC in drive B:.

MOVE &.DOSPLUS.\LC.* -NET B:\LC -DOS

4. Copy all files with type LIB from ANFS DOS subdirectory DOSPLUS\H to DOS directory \LC\H.

MOVE &.DOSPLUS.\LC.\H.LIB.* -NET B:\LC\H -DOS

Note that when copying from ANFS, the source subdirectory must be referenced back to the URD using the '&' character, because the currently selected directory in ANFS cannot be restored after the MOVE operation.

Copying Files Between MOS and MOS

In addition to copying files between DOS and MOS, files can also be copied directly from MOS FS to MOS FS, 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 flies from the specified directory. It 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 AGES and DFS *COPY command or MOS *MOVE command and is suitable for copying MOS files (e.g. BBC BASIC programs or VIEW text files).

It is also possible to copy a MOS directory that contains DOS files and DOS filetype sub-directories by specifying the /C option in the source file specification. This type of operation is most suitable for copying DOS files that have been saved to a MOS FS disc by a previous MOVE command.

As an illustration, the DOS files copied to the NET directory DOSPLUS in the previous examples 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 to create the appropriate directories, if they do not already exist.

*adfs
*mount 1
*cdir dosplus
*cdir dosplus.\lc
*cdir dosplus.\lc.\h
*cdir dosplus.\docns

The following MOVE commands will then perform the copy:

MOVE &.DOSPLUS.* -NET /C :1.$.DOSPLUS -ADFS
MOVE &.DOSPLUS.\DOCNS.* -NET /C :1.$.DOSPLUS.\DOCNS -ADFS
M0VE &.DOSPLUS.\LC.* -NET /C :1.$.DOSPLUS.\LC -ADFS
MOVE &.DOSPLUS.\LC.\H.LIB.* -NET /C :1.$.DOSPLUS.\LC.\H -ADFS

Moving MOS Directories

As an example of a similar MOVE listing only MOS FS files, if NET user ERIC also has directories $.ERIC.BASIC and $.ERIC.VIEW,containing, say, BBC BASIC programs and VIEW text files, these could be copied to the same ADFS disc (assuming directories :1.$.BASIC and :1.$.VIEW exist) using the following two MOVE commands:

MOVE &.BASIC.* -NET :1.$.BASIC -ADFS 
MOVE &.VIEW.* -NET :1.$.VIEW -ADFS

Wild Card File Specifications

In the examples above, a group of files has been specified by the '*' wildcard character. This, of course, will match all files in a source directory, for both DOS and MOS files.

It is also possible to specify partial wildcard matching. This means that files must always match a limited range of actual characters, with other individual specified characters remaining wild, for them to qualify for copying. This is achieved by using combinations of the wildcard characters *, ? and #. These wildcard characters have different meanings, which depend on the source filing system. These dependancies are summarised in the following table:

Filing System	Wildcard	No. Characters Matched
DOS		*		0-8 or 0-3(extension)
DOS		?		0-1
MOS		*		0-10
MOS		#		1

Table 10.1 Wildcard Facilities in DOS and MOS

There are certain differences between the use of wildcards for DOS and MOS filing systems which should be noted. To illustrate, consider the following (improbably named) DOS files after they have been copied to a MOS filing system (i.e. ADFS or NFS).

A.BAT
AA.BAT
AB.BAT
ABC.BAT
TEXT1B.DOC
TEXT2B.DOC
TESTB.DOC

These would be copied to the MOS FS using the following names

BAT.A
BAT.AA
BAT.AB
BAT. ABC
DOC.TEXT1B
DOC.TEXT2B
DOC.TESTB

The following table shows which files would be matched by the various DOS and MOS wildcard file specifications.

FS	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	TEXT1B.DOC -TEXT2B.DOC TESTB.DOC
MOS	*		All 7 MOS files
MOS	BAT.A*		BAT.A BArAA 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.TEXTIB DOC.TEKT2B DOC.TESTB
MOS	DOC.T*X*B	DOC.TEXT1B DOC.TEXT2B

Table 10.2 Examples of file Matching using Wildcards.

It can be seen that the DOS single character wildcard, 'r and the MOS single character wildcard, '#' behave differently. In DOS .7. will match any single character or a space Cie, no character) while in MOS, '#' matches only a non-space character.

The global wildcard '*' functions identically for DOS and MOS if it is used as the last character of the filename or filetype.

When issuing MOS wildcard specifications, the '*' character need not be the last character of the filename or type. It is, therefore, possible to use patterns such as *A to mean 'all files ending in A', or run to mean 'all files starting with T and ending with B'. However, uch patterns are illegal in DOS and may not be used. This means that care must be taken when copying from MOS to DOS when destination flames are not explicit.

You must ensure that the wildcard specification will copy all the required files. That is to say, ensure that all the default destination names will be valid. if you are uncertain about whether all the ales will be copied correctly you should use a more explicit pattern. If this causes more files to be copied than required, simply delete any destination files which are not required.

Occasionally using a wildcard specification may result in two destination names being the same when 'translated' to the other filing system. In such cases, the solution is to supply the full source file name and possibly a destination name too.

Wildcard file specifications are permitted only in host filing systems that support the OSGBPB function with A=8 (read names from current directory). This includes DPS, ADFS, NFS and ANFS but excludes cps (cassette) or RES (ROM filing system).

For CFS and RFs all file specifications must exclusively identify a single file and therefore wildcards are prohibited.

Filename Character Translation

When copying from DOS to MOS the destination filename is formed from the filename and nietype of the source DOS file. In a few special cases this can produce a destination filename which contains invalid characters and which 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
	#	?
	$	
	&	{
	-	+
	@	=

Table 10.3 Character Translation for Invalid characters

The corresponding MOS characters have been chosen to ensure that no conflict occurs with other non-alphanumeric DOS characters that do not require translation.

When copying MOS flies from MOS to DOS (e.g. text files), the following additional non-alphanumeric characters are invalid in DOS and are translated to the underscore character.

The following non-alphanumeric characters are valid under both the MOS and DOS and are not translated:

The use of meaningful filenames, avoiding the inclusion of meaningless chandem in file or directory specifications is by far the best method of preventing compatibility problems between different filing system character conventions.