direct: Avoid leaving file content in misctemp if interrupted.
This commit is contained in:
parent
aa31a7182e
commit
bb6cec3461
4 changed files with 14 additions and 9 deletions
|
@ -353,11 +353,8 @@ toDirectGen k f = do
|
|||
void $ addAssociatedFile k f
|
||||
modifyContent loc $ do
|
||||
thawContent loc
|
||||
replaceFileOr f
|
||||
(liftIO . moveFile loc)
|
||||
$ \tmp -> do -- rollback
|
||||
liftIO (moveFile tmp loc)
|
||||
freezeContent loc
|
||||
liftIO (replaceFileFrom loc f)
|
||||
`catchIO` (\_ -> freezeContent loc)
|
||||
fromdirect loc = do
|
||||
replaceFile f $
|
||||
liftIO . void . copyFileExternal loc
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue