Skip to content

make-dir-store is not atomic #135

Open

Description

@LiberalArtist

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions