[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: persistent file locks
From: |
Michael Heerdegen |
Subject: |
Re: persistent file locks |
Date: |
Thu, 06 Feb 2014 07:57:52 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) |
Eli Zaretskii <address@hidden> writes:
> > When the user runs multiple Emacs processes, my lib should not cause
> > both processes to append to one and the same file. I want to use Emacs
> > file locks for preventing that. After reading
> > (info "(elisp) File Locks"), it seems that locks are handled only
> > implicitly, and are removed when the associated buffer is not modified
> > any more. I need a persistent lock. Is there a way to achieve this?
> > Or what would you recommend to do instead?
>
> Name the file with the Emacs PID in the file name?
Thanks. That would work, but it would mean that I would either
pollute some user's directory with lots of differently named log files,
or I would have to implement some merging/removing mechanism for those.
I would prefer a solution with a constant log file name (additional
Emacs processes would just avoid logging if the file is locked, or
alternatively log into a different file named emacs-log~2 or so).
Eli, does your answer imply that there are only workaround solutions,
i.e., that there is no clean way to avoid automatic lock removal by
Emacs?
Thanks,
Michael.