91h FL$WCPY file copy with wildcards
Input D register - addr of 'copy-to' string.
X register - addr of 'copy-from' string.
UTW_S0 - address of user routine or 0000 for no routine.
Output - none -

Wild file copy, works in a similar way to FL$COPY.

Copies files or block files from one device to another.

X points to the 'copy from' string, D points to the 'copy to' string.

The copy-from device must not be the same as the copy-to device. A file may be copied to a different name on the target device. If a device only is specified in the copy-to string, the file is copied with the same name.

Note: When used to copy an OPL procedure to a different name, FL$WCPY does not actually change the name on the first line of the procedure. This means if an OPL procedure is copied to a different name and then listed on a printer, it will be shown with the original name.

The following wild cards are allowed in the 'copy-from' name, but not in the 'copy-to' name.

    *   match any number of any characters.
    +   match any 1 character.

It can also contain any of the following file extensions:

  • .ODB - text files
  • .OPL - OPL procedures (text and object)
  • .OPT - OPL procedures (text only)
  • .OPO - OPL procedures (object only)
  • .DIA - CM/XP diary save files
  • .COM - Comms Link setup files
  • .PLN - Spreadsheet files
  • .PAG - Pager setup files
  • .NTS - Notepad files
  • .TY8-TYF - file types (88-8F)

Note that if the 'copy-from' name contains wild characters, the 'copy-to' name must be be the device name only, eg "B:".

eg, the following is ILLEGAL: From A:*.DIA To B:*.ODB

Note that the "to" name can never have wild chars or file extensions.

UTW_S0 contains the address of the user's routine to be called for each file copied, e.g. to print file names. When it is called, X reg will point to the filename and A reg will have its file type.

This call is not available on CM/XP machines.

Example To copy all OPL procedures (text and object) starting with the letter "X" from A: to B:
        STD     UTW_S0:         ;no routine called
        LDX     #COPY_FROM
        LDD     #COPY_TO
        OS      FL$WCPY
        BCS     ERROR

        ASCIC   "A:X*.OPL"
        ASCIC   "B:"
Errors 194 - battery too low
200 - read pack err
232 - pack not copyable
233 - directory full
234 - file not found
236 - bad file name
238 - end of file
239 - pack full
240 - unknown pack
241 - pack not blank
242 - pack changed
243 - bad device name
244 - read only pack
245 - write pack err
246 - no pack