better temp file handling
This commit is contained in:
parent
1bae56e4a0
commit
e32dda07ca
1 changed files with 4 additions and 5 deletions
|
@ -55,10 +55,9 @@ lockDown file = do
|
||||||
liftIO $ preventWrite file
|
liftIO $ preventWrite file
|
||||||
tmp <- fromRepo gitAnnexTmpDir
|
tmp <- fromRepo gitAnnexTmpDir
|
||||||
createAnnexDirectory tmp
|
createAnnexDirectory tmp
|
||||||
pid <- liftIO getProcessID
|
liftIO $ do
|
||||||
let tmpfile = tmp </> "add" ++ show pid ++ "." ++ takeFileName file
|
(tmpfile, _handle) <- openTempFile tmp (takeFileName file)
|
||||||
liftIO $ nukeFile tmpfile
|
createLink file tmpfile
|
||||||
liftIO $ createLink file tmpfile
|
|
||||||
return $ KeySource { keyFilename = file , contentLocation = tmpfile }
|
return $ KeySource { keyFilename = file , contentLocation = tmpfile }
|
||||||
|
|
||||||
{- Moves a locked down file into the annex. -}
|
{- Moves a locked down file into the annex. -}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue