Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make-dir-store is not atomic #135

Open
LiberalArtist opened this issue May 11, 2024 · 0 comments
Open

make-dir-store is not atomic #135

LiberalArtist opened this issue May 11, 2024 · 0 comments

Comments

@LiberalArtist
Copy link
Contributor

While looking at a Discourse thread, I noticed that make-dir-store uses (with-output-to-file #:exists 'replace ...):

(with-output-to-file
(build-path home (bytes->string/utf-8 key))
(lambda ()
(write value))
#:exists 'replace))

It seems like it would be better to use call-with-atomic-output-file here: if somehow you ended up with a partially-written file, it seems like it would be very painful to debug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant