-
Notifications
You must be signed in to change notification settings - Fork 56
withBinaryFileDurableAtomic fails with nested folders #160
Copy link
Copy link
Closed
Description
Whenever a file that is being written to is located in a sub directory withBinaryFileDurableAtomic results in a runtime exception during the atomic rename.
Same problem applies to writeBinaryFileDurableAtomic.
Here is a short repro:
import Import
import RIO.Directory
import RIO.File
run :: RIO App ()
run = do
logInfo "We're inside the application!"
let foo = "foo.txt"
withBinaryFileDurableAtomic foo WriteMode $ \h -> do
hPutBuilder h "foo"
logInfo $ "Written " <> fromString foo
let barFoo = "bar/foo.txt"
createDirectoryIfMissing True barFoo
withBinaryFileDurableAtomic barFoo WriteMode $ \h -> do
hPutBuilder h "bar - foo"
logInfo $ "Written " <> fromString barFooWhich results in:
$ stack run
We're inside the application!
Written foo.txt
atomic-durable-exe: closeFileDurableAtomic - renameFile: does not exist (No such file or directory)Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels