#3231: Permission denied error with runProcess/openFile
---------------------------------+------------------------------------------
Reporter: NeilMitchell | Owner: simonmar
Type: bug | Status: closed
Priority: normal | Milestone: 6.12.1
Component: Runtime System | Version: 6.10.4
Severity: normal | Resolution: invalid
Keywords: | Difficulty: Unknown
Testcase: | Os: Windows
Architecture: Unknown/Multiple |
---------------------------------+------------------------------------------
Comment (by duncan):
Replying to [comment:28 yugr]:
> Fine but can I fix my code? I tried to use readFile $! tempFile (strict
application) but it did not work...
The point is readFile opens the file but does not read the content until
you consume the String. The solution is either to 1) consume all the data,
2) use System.IO.withFile, or as Neil suggests, 3) to read the whole file
into memory up front.
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/3231#comment:30>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs