in reply to random read wite access to a fixed file

If you want to write at the end of the file, just seek there and write. If you want to write somewhere else in the file and you are going to write exactly the same length of data as you are replacing, seek there and write. If you are going to be inserting, rather than replacing, you'll need to either dump to a backup and re-write the whole file, or dump into memory, seek to the begining, truncate, the file, dump back from memory and save.
  • Comment on Re: random read wite access to a fixed file

Replies are listed 'Best First'.
Re^2: random read wite access to a fixed file
by vinforget (Beadle) on Nov 17, 2004 at 16:05 UTC
    Yes, I plan to repleace the same length of data as i intend to write i.e. just changing the 0 or 1 to a 1 or 0.
    Thanks for the help.
    Vince