Beebug


Practical Disc-File Techniques

Publisher: Pentire Press
Machine: BBC B/B+/Master 128

 
Published in Beebug #45

Practical Disc File Techniques

Good books on file handling are few and far between. Mike Williams, fresh from his endevaours with the Beebug Filer, reports on one which is enjoyable to read as well.

If you have been following our various articles on the Beebug Filer database prorgam that have appeared in Beebug since last November then you will have become familiar with the use of files and databases. You may have considered writing some file-handling programs yourself, but unless you are already a fairly competent programmer, the thought of doing so may have seemed quite daunting. Where do you start? And where can you find out all you may need to know?

Well, this new book by Peter Beverly-Brown may be just what you are looking for. The approach is very practical and down-to-earth, and ideal for the programmer who wants to extend his knowledge to file handling. The book has the major merit of being eminently readable, so much so that like a good novel you will find it hard to put it down. And yet, even the more experienced programmer is likely to find much of interest.

Initially, the book covers much of the essential detail required for file handling, how to create files of the right length, how to read and write to files, and ideas like that used in Filer, where a description of the files structure can itself be stored as part of the file.

Chapter 4 describes the programming of 'serial' files, though I have some reservations with the author's terminology. The point is that a disc is intrinsically a direct access device - so you can always [some text missing[ proceeds directly to any location on the disc. But this is only a minor quibble, and the book is too full of good advice to worry unduly about academic niceties.

'Random' access is covered in the next chapter, but I would claim that the author is really describing a sequential file to which the disc drive provides direct access to each record. Again, ignoring the terminology, the information and examples given are useful and practical. Chapter 6 deals with the rudiments of index-sequential files which is an important technique for the fast access of records held in some kind of order. It is a file format commonly used commercially and well worth the trouble of learning about.

The chapter on searching and sorting is rather disappointing, despite several references by the author to past issues of Beebug. If the entire contents of a file can be read into the computer's memory then searching and sorting is easy. Dealing similarly with files that are much larger requires different techniques and these are only touched on briefly. This is an important subject because a poor choice of algorithm can easily lead to inefficient and slow file processing. More information here would have been welcome.

The book concludes with a round-up of disc-file hints for 'good house-keeping' and a complete listing of the author's 'Really Useful Program' for file handling. Despite my criticisms of some of the later sections of this book, I thoroughly recommend it to those Beebug members who wish to lean about file handling from scratch. In this respect, it must be one of the most useful and readable books on this subject yet produced.