web-server
web-server copied to clipboard
`make-dir-store` is not atomic
While looking at a Discourse thread, I noticed that make-dir-store uses (with-output-to-file #:exists 'replace ...):
https://github.com/racket/web-server/blob/87a1e58a9b92c621f7d96c76de1da39587f04140/web-server-lib/web-server/stuffers/store.rkt#L9-L13
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.