WCOPY [#ch,] [wild1] [TO wild2](Toolkit II) or

WCOPY [#ch,] wild1 TO wild2(THOR)


Toolkit II, THORs

The command WCOPY is intended to allow you to copy several files with a common root from one device to another, quickly and easily.

It is however necessary to understand the way in which Toolkit II’s wildcards work, as WCOPY uses these wildcards to find the required files. A wildcard is a means of finding several files which have similar names.

The first thing which any wildcard command does is to look at the supplied parameter and then compare this against each entry in the directory of the given device. If any of the filenames match exactly, or if the parameter forms the start of any filenames, those files are marked as chosen. For example:

WCOPY flp1_D TO flp2_

would copy all files whose names are either ‘D’ or begin with the letter ‘D’ to flp2_ (the comparison is case independent).

However, wildcards can be much more complex and wonderful on the QL. If you place two underscores (’_’) together as part of wild1, this is taken to be a wildcard and can in fact be replaced by any string of characters in order to match filenames with wild1. Wildcards are further complicated by the fact that if a device name is not provided as part of wild1, then the default device will be added (which ends with an underscore, so if wild1 begins with an underscore, you will have a wildcard symbol!!) A few examples of wildcards (assuming default device is ‘flp1_’):


Wild Card Name

File Matches










WCOPY uses both wildcards for ascertaining the names of the files to be copied, and the files to be created. However, both wild1 and wild2 are dealt with distinctively.

WCOPY will use the rules on wildcards to search for files which match with wild1 on the specified device, or the default data device if no device is specified. However, the rules for determining the destination parameter wild2 are complex:

  1. If no device is given, but a filename is specified, WCOPY looks at wild1. The destination device is then assumed to be the same as the source device (ie. the device name specified as part of wild1, or if omitted, DATAD$).

  2. If the second parameter is omitted, then again WCOPY looks at wild1. If a device is given in the first parameter, then this is used as the destination device. On the other hand, if no device was specified, then the default destination device will be used (see DESTD$).

  3. If a second parameter is given which includes a device name, then this is used! Having decided upon the device to which the files are to be copied, WCOPY then looks at the remainder of wild2 to ascertain what to do with the filenames it has found.

Before trying to understand how this works, it is essential to realise that there is an implicit wildcard placed at the end of both wild1 and wild2.

WCOPY will look at wild2 and compare each filename that it has found using the wildcards in wild1 in turn. If a wildcard in wild1 is matched by a wildcard in wild2, then that part of the source filename will be inserted into the destination filename. However, beyond this, WCOPY will use the rest of wild2 as the actual destination filename. Any additional sections in wild1 or wild2 will be inserted after the drive name in the destination filename. See the examples below!

Having decided which files are to be copied and the names they are to be given on the device where they are being copied to, WCOPY will then request confirmation in the specified channel (default #0) for each file, by printing the following message in the channel:

source_file TO destination_file..Y/N/A/Q?

You will then need to press <Y> to copy that file across, <N> to miss that file out, <A> to copy all files which match with wild1, or <Q> to leave WCOPY. In this instance, <ESC> and <CTRL><SPACE> both act as <Q>.

If the destination file already exists, another prompt will be shown in the form:

OK to overwrite..Y/N/A/Q?

You will then need to press <Y> to overwrite that file, <N> to go onto the next file, <A> to overwrite this and all other files being copied if they already exist, or <Q> to stop WCOPY. Again, <ESC> and <CTRL><SPACE> act as <Q>.


Assuming that the default data device is flp1_ and the default destination device is ram2_:


Copies all files on flp1_ to ram2_

WCOPY flp1_test TO ram2_old


flp1_testa to ram2_olda
flp1_test_v1.00_bas to ram2_old_v1.00_bas
WCOPY flp1_test, ram2_old_


flp1_testa to ram2_olda
flp1_test_v1.00_bas to ram2_old_v1.00_bas
WCOPY _bas to ram2_


ram1_test_v1.00_bas to ram2_bas
ram1_old_v0.01_test_bas to ram2_bas
WCOPY _bas, ram2__


ram1_test_v1.00_bas to ram2_test_v1.00_bas
ram1_old_v0.01_test_bas to ram2_old_v0.01_test_bas
WCOPY old__ TO ram2_


ram1_old_v0.01_test_bas to ram2_v0.01_test_bas
ram1_old_v1.00_exe to ram2_v1.00_exe
ram1_old_data to ram2_data


The TO in the syntax can be replaced by a comma ‘,’ as per a number of the above examples.


On the THOR range (v4.02+) the word ‘TO’ in the prompts is replaced by the symbol =>


On the THOR range, the prompt message are altered from ‘Y/N/A/Q’ to ‘Yes/No/All/Quit’.


As with COPY, WCOPY does not copy the header to serial devices (eg. ser) if this is specified as the destination. However, the THOR variant of this command actually looks to see whether the file-type or file dependent information fields are non-zero in which case the header is always copied.


If you have level-2 device drivers, any sub-directories in the specified source directory are ignored by WCOPY. For example, if:

DIR flp1_

gave the following result:

Psion Disk
400/1440 sectors


WCOPY flp1_

would have no effect. However, compare:


which would copy all of the files in the sub-directory ‘QUILL’ to the current destination device.


Both parameters must be supplied for the THOR variant of this command, otherwise the error ‘Bad Parameter’ will be reported.


Current versions (at least up to v2.85) of WCOPY do not work correctly with the DEV device when this is pointing at a sub-directory (eg:


WCOPY will however work if the DEV device is pointing at a root directory, eg:

DEV_USE 1, flp1_.


SPL_USE and DEST_USE set the destination device. See COPY, WCOPY_F and WCOPY_O which are all similar. WREN, WDIR, WSTAT and WDEL all use wildcards. COPY and SPL allow you to copy specific files.