right, thanks. for me, a random access file is slightly different from what's in the randomaccessfile library.
the error i received has been addressed (with thanks), and i do see the library as a way to save/restore a list of objects. but i don't see it as permitting random access. is there, perhaps, another library?
what i'm referring to goes back to pre-historic, pre-sql times. (of course, the term "random" access is a misnomer, since the access is not random at all.) but, for me, random access meant i could position the file cursor at various parts of the data file (based on the size of the structure or record i was dealing with). among others, the options available involved positioning the file cursor with respect to the beginning of the file, the end of the file or the current position in the file. if the size of a structure used for each record in the database was 128 bytes (derived from a convenient sizeof() function), and i wanted to access the 10th record, i could simply position the cursor at 9 * 128 bytes from the start of the file and read 128 bytes to access that record. ditto for writing it back out.
with the randomaccessfile library, it seems to me that to correct the 10th record, i either have to read all the records in or at least read 10 in one at a time, step through the list until i get to the record i want, edit it, and then write the entire list back. even if i only read in 10 records and stopped, i would still have to write at least 10 records back (from the start of the file - a maneuver over which i have no control).
that said, i noticed that if i queried the current file position after appending a new record, it indirectly tells me what the size of my structure is, but that strikes me as an undocumented feature. in any case, and even if i could rely on that feature, i don't see any way to position the cursor (randomly) to access a given record based on it.
i can query the current file position. how do i set it?