Rescuing the
Domesday
Data




At some point I will put up a listing of CHUNKFILE because it's rather ingenious, even though I say so myself. In fact, it's probably one of the best things I've ever written.

The beauty of using Beebs is that the lovely Acorn operating system and filing systems have plenty of operating system calls which programmers can use to make life easy.

Frankly I was dreading having to write a routine to load sections of files into memory and then save the sections to another medium. I was imagining having to keep a memory pointer going as well as a disc pointer and read a bit into memory and then update the memory pointer ready for the next bit and then update the disc pointer to go and get the next bit to put into memory at the memory pointer, whilst all the time checking for end of file and end of RAM. Yuck!

But here we are dealing with Acorns, computers built by people who believe that computers are tools to be used by humans to speed up and automate repetitive and time consuming chores, leaving us free to do other things like create websites telling the world how much free time we have available to spend telling people how much easier it was using 20 year old computers to do the things we should have been able to do if computers were made properly nowadays!

So using the operating system OSGBPB call, I can read any given length of data up to 16MB into RAM starting at any given RAM location, from any point within a file, using just one call and a ludicrously simple parameter block!

This is the basis of CHUNKFILE, but first a few questions. I wanted to be able to set the amount of RAM to be used as the buffer, so that's the first question, then I wanted it to work out whether the file would fit in memory all at once, and if not prompt for automatic copying meaning I could turn the lights off and go to bed or do it manually so that the exact starting point within the file could be selected, in other words to be able to resume from abortive previous attempts without having to start from scratch.







Click here to go back