GNU bug report logs -
#75209
30.0.93; Emacs reader failed to read data in "/home/nlj/.cache/org-persist/gc-lock.eld"
Previous Next
Full log
Message #53 received at 75209 <at> debbugs.gnu.org (full text, mbox):
> From: Ihor Radchenko <yantar92 <at> posteo.net>
> Cc: njackson <at> posteo.net, 75209 <at> debbugs.gnu.org
> Date: Sun, 05 Jan 2025 10:03:49 +0000
>
> > And if the cache is common to all sessions, then perhaps reading the
> > index before writing it should avoid several sessions step on each
> > other's toes?
>
> You are right. The only problem is short-living caches that should be
> cleared at the end of Emacs session that created it.
Does this mean you have ideas for solving this problem by reading the
file before it is written? Or does this mean you already read the
file before writing to it?
> > One way of rewriting a file atomically is to write the stuff to a
> > temporary file, then rename it to the target name. If Org doesn't
> > already do that, maybe you should try doing that (together with
> > reading the file before updating it)?
>
> Org uses `with-temp-file'. Is there an alternative built-in and more
> robust way to write string to file?
Writing to a file is not atomic. If you instead write to a temporary
file, then rename it to the final file name, the renaming is atomic on
Posix filesystems.
This would mean you can still use with-temp-file, but with a temporary
file name as its argument, and you need to add a single rename-file
call afterwards.
This bug report was last modified today.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.