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.
While looking at a Discourse thread, I noticed that
make-dir-storeuses(with-output-to-file #:exists 'replace ...):web-server/web-server-lib/web-server/stuffers/store.rkt
Lines 9 to 13 in 87a1e58
It seems like it would be better to use
call-with-atomic-output-filehere: if somehow you ended up with a partially-written file, it seems like it would be very painful to debug.