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:
parent
0265badefb
commit
d80a0f62a4
1 changed files with 2 additions and 1 deletions
|
@ -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.
|
||||
-
|
||||
|
|
Loading…
Add table
Reference in a new issue