avoid lazy read of file contents

On Windows, that means the file could still be open when later code wants
to delete it, which fails. Since we're only reading 8k anyway, just read
it, strictly. However, avoid reading the whole file strictly, so no
getContentsStrict here.
This commit is contained in:
Joey Hess 2013-06-17 21:12:09 -04:00
parent 0265badefb
commit d80a0f62a4

View file

@ -52,7 +52,8 @@ getAnnexLinkTarget file =
readfilestart f = do
h <- openFile f ReadMode
fileEncoding h
take 8192 <$> hGetContents h
s <- take 8192 <$> hGetContents h
length s `seq` (hClose h >> return s)
{- Creates a link on disk.
-