hGetStringBuffer: hClose the file after we've read it (duh). This
causes a real problem on Windows, where the file remains locked in
GHCi, and cannot be modified until after the finalizer has closed it
(bug #1047408).
import GHC.IO ( slurpFile )
#endif
-import IO ( openFile, hFileSize, IOMode(ReadMode) )
+import IO ( openFile, hFileSize, IOMode(ReadMode),
+ hClose )
#if __GLASGOW_HASKELL__ >= 601
import System.IO ( openBinaryFile )
#else
arr <- newArray_ (0,size_i-1)
r <- if size_i == 0 then return 0 else hGetArray h arr size_i
#endif
+ hClose h
if (r /= size_i)
then ioError (userError "short read of file")
else do