in reply to Shifting the top line(s) of a file?
If you can accept a fixed number of fixed sized entries you could (with appropriate locking, of course) make a ring buffer. Store the head and tail offsets as the first record and then use something along the lines of seek( RING, $rec_num * REC_SIZE() + OFFSETSIZE(), SEEK_SET() ) and sysread( RING, $buf, REC_SIZE() ) to retrieve them.
|
|---|