CIO and FMS copy commands - FujiNetWIFI/fujinet-firmware GitHub Wiki

Different FMSes handle the copy command differently, and thus we need to effectively parse the filenames being passed back and forth between the CIO and our driver so that things will work correctly.

DOS 2.0

The C command has some interesting quirks:

  • Filenames must be a maximum of 15 characters, including device spec. Anything longer and you get FILENAME TOO LONG.
  • The IOCB read from is passed a filename buffer containing both filename paths with device specs, seperated by comma, e.g.
SELECT ITEM OR RETURN FOR MENU
C
COPY--FROM, TO?
D1:OKI92A,D2:OKI92A

Results in IOCB #1 being opened with a filename value of:

D1:OKI92A,D2:OKI92A

Indicating that we need to tokenize by the comma character and only parse the first part of the comma.

Source being E:

opening from E: is a special case in the DOS 2.0 FMS, the editor is not re-opened, and the existing IOCB #0 is used.

MYDOS 4.53

MyDOS does not exhibit the quirks when using copy, it seems the buffer is tokenized by comma, and the source is opened on IOCB #1 with the first filename, with IOCB #2 opening with the second filename.

Source being E:

Source or destination not containing a filename (E:, P:, etc.), is passed to CIO as: e.g. "E:**", as an aside, MyDOS will open E: if specified on IOCB #7.

Destination devices with no filename

If A device is specified as destination without a filename, the source filename will be concatenated. e.g.

Select Item (RETURN for menu):C
File source, destination?
D2:TEST,P:

IOCB #1 will have the following filename:

D1:TEST

IOCB #2 will have the following filename:

P:TEST

OS/A+ / DOS XL 2

The same FMS, but a drastically different DUP implemented as a CLI.

  • Copy command opens each file on a seperate IOCB.
  • Filenames without extensions have a . added to the end, e.g.
D1:TEST

becomes

D1:TEST.
  • If destination does not have a filename (e.g. E: P: N:), then the filename is concatenated, so:
D1: COPY D2:TEST E:

Opens an IOCB #1 with filename:

D2:TEST.

and opens an IOCB #2 with filename:

E:TEST.

Source paths without a filename

For source paths without a filename, copy will append a wildcard specification of ., e.g.

D1: COPY E: D2:TEST2

COPY will open IOCB #1 with the following filename

E:*.*

and will open IOCB #2 for writing with the following filename

D2:TEST2

[!important] There is no period in the TEST2 filename, copy doesn't add one in this case.

OS/A+ 4.1

Similar code-base to OS/A+ 2, with the difference that the Apple DOS FMS is used, instead of the Atari DOS 2.0 FMS.

COPY Filenames

OS/A+ 4.1 COPY uses a fixed file length of 33 characters, padded with spaces. e.g. given a COPY command of

D1: COPY D1:ADOS.COM D2:

COPY will open source as IOCB #1 as:

"D1:ADOS.COM                      "

and destination as IOCB #2 as:

"D2:ADOS.COM                      "