on 1/23/02 11:54 AM, [EMAIL PROTECTED] purportedly said:

> what is the command to WRITE in the way of random access?
> Is there a command opposite to "read"?

Not that I recall, but it isn't necessary. You would use pack() to fix the
length.

One fixed length caveat: if you want to completely delete a record, you can
get back into the whole file rewrite problems again. This can be avoided by
doing what many database system do, and re-use record space. An example
would be having a status byte or overwriting the record with spaces. By
indicating in the index that the record is empty, you can then write into
the first available empty record space. Alternatively, when reading, you can
skip blanks, and when writing, write to the first blank record or the end of
the file, whichever comes first. seek() is you best friend ;-)

Keary Suska
Esoteritech, Inc.
"Leveraging Open Source for a better Internet"

Reply via email to