Lisp HUG Maillist Archive

concurrent read/write to a file

Hello Lispers!

How to write the/a right way to a file that is read and written
simultaneously by different programs?

I have a web server, lighttpd to be precise. And I have a lisp
(lispworks) connected to it via scgi. I want to write to files some
content that is served/used by the server. That is html files and a
file with user access privileges.

I'm concerned with these situations:
1. The server serves the content of a file and I'm trying to rewrite
the same file.
2. I'm rewriting the file, the server starts to serve the content
after my start.

Is there some sort of locks for files? Any other ideas, like writing
to a temporary file and replacing the old file with the new temp file?
Any lisp-way, lispworks way? Just links to read/educate myself on this
topic?

The oses are Linux (would be the primary os) and Windows XP.


Best,
 Art


Updated at: 2020-12-10 08:39 UTC