Absolute Piffle

General commentary and new links from Richard Gillmann. Sometimes it's funny, sometimes it's serious, and sometimes it's just there.

Monday, July 21, 2003

I've tossed everything else into this blog, why not a little C++ code? Here's a routine for locking files in C++. I couldn't find a good example on the web, so perhaps this will be of use to someone. This code has been tested on Linux. For Windows, you'll have to do something different, using _sopen I think.

Update, September 2005: This code has proved so popular in my weblog stats, that I have moved it to a new page on my site for especially for C++ code. I hope to add more code later.