all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Michael Heerdegen <michael_heerdegen@web.de>
To: emacs-devel@gnu.org
Subject: Re: persistent file locks
Date: Thu, 06 Feb 2014 07:57:52 +0100	[thread overview]
Message-ID: <87r47ghgnj.fsf@web.de> (raw)
In-Reply-To: 83r47gzrp9.fsf@gnu.org

Eli Zaretskii <eliz@gnu.org> 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.




  reply	other threads:[~2014-02-06  6:57 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-03 23:41 How to successively log stuff to a file? Michael Heerdegen
2014-02-04 12:36 ` Stephen Berman
2014-02-06  3:37   ` Michael Heerdegen
2014-02-06  3:54   ` persistent file locks (was: How to successively log stuff to a file?) Michael Heerdegen
2014-02-06  6:21     ` Eli Zaretskii
2014-02-06  6:57       ` Michael Heerdegen [this message]
2014-02-06  8:34         ` persistent file locks Eli Zaretskii
2014-02-07 12:27           ` Michael Heerdegen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87r47ghgnj.fsf@web.de \
    --to=michael_heerdegen@web.de \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.