I tried to write a file-copy command this morning, in z80 assembly, however it turned out to be painful:
Open the source file
Count the number of blocks.
Close the source file
Open the source file
Read a block of data
Close the file
Open the destination file
Write the block of data
Close the file
Goto 4 until all blocks are copied.
The root cause of this is that we only keep one cached/open filehandle - when an OpenFile request is made we close any previously opened file.
We need to allow N files to be opened, perhaps with a lower mask. We can probably assume that the Open/Read/Write/Close operations carried out will keep the same FCB address. We can probably fill in FCB.Al with the filehandle, or some other "invisible" strucutre. Needs thought, but we should do better.
I tried to write a file-copy command this morning, in z80 assembly, however it turned out to be painful:
The root cause of this is that we only keep one cached/open filehandle - when an OpenFile request is made we close any previously opened file.
We need to allow N files to be opened, perhaps with a lower mask. We can probably assume that the Open/Read/Write/Close operations carried out will keep the same FCB address. We can probably fill in FCB.Al with the filehandle, or some other "invisible" strucutre. Needs thought, but we should do better.