in reply to After a good example of efficient record handling...

See pack and unpack for record handling; sysopen, sysseek, sysread, syswrite for retrieving or writing records; and flock for keeping the files from being modified during writes. As mentioned above, post contents should be in a separate file, with the post record containing just start and end offsets. This keeps your records neat and fixed-length. If your users are allowed to do edits, you should allocate a few extra characters for post content so small increases don't require moving it to a new spot in the file. After the time limit for edits is reached, your clean-up utility can rewrite the content to exact size.

It would, however, be simpler to just do this with mySQL. Certain things like indexes can get quite complicated to program.

  • Comment on Re: After a good example of efficient record handling...