Subject: Re: bug#75209: 30.0.93; Emacs reader failed to read data in "/home/nlj/.cache/org-persist/gc-lock.eld"

From: Ihor Radchenko <[email-masked]>
Date: Sat, 15 Mar 2025 17:43:49 +0000

"N. Jackson" <[email-masked]> writes:

> By the way, the previous diff (for the atomic write juggle for
> Windows systems) results in errors like these:
>
> Error running timer `org-persist--refresh-gc-lock': (file-already-exists "File already exists" "/tmp/org-persist-1p8805")
> ...
> I think you need the 'overwrite flag in the call to rename-file.
> I.e.:
>
>       (let ((tmp-file-2 (make-temp-file "org-persist-")))
>         ;; Just renaming may still not be atomic on Windows, so we do
>         ;; a bit more complex juggle.
>         (rename-file file tmp-file-2 'overwrite)
>         (rename-file tmp-file file 'overwrite)
>         (delete-file tmp-file-2)))

Ouch. Not 'overwrite flag, but `make-temp-name' instead of `make-temp-file'.

-- 
Ihor Radchenko // yantar92,
Org mode maintainer,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>