[Haskell-cafe] mueval leaving behind tmp files
Johannes Waldmann
waldmann at imn.htwk-leipzig.de
Mon Apr 2 18:49:13 CEST 2012
The following program prints Right ("test","Bool","True")
as it should, but it leaves behind in /tmp
two files (name is a long string of digits)
and an empty directory (name is ghcNNNNN_N).
... and it deletes the input file (/tmp/Main.hs).
That's not nice. Ideally, I would want to read input
from a String (instead of the file), and not write to disk at all.
But cleaning up properly would be OK as a work-around.
import Language.Haskell.Interpreter
import Mueval.Interpreter
import Mueval.ArgsParse
main = do
writeFile "/tmp/Main.hs" "test = True"
result <- runInterpreter $ interpreter $ Options
{ timeLimit =1, modules =Just ["Prelude"], expression ="test"
, loadFile ="/tmp/Main.hs", user="what", printType =True
, extensions =False,namedExtensions = []
, noImports =False, rLimits =False, help=True
}
print result
ghc --version
The Glorious Glasgow Haskell Compilation System, version 7.4.1
ghc-pkg list| egrep 'mueval|hint'
hint-0.3.3.4
mueval-0.8.1.1
uname -a
Linux octopus 3.0.0-16-generic #29-Ubuntu SMP Tue Feb 14 12:48:51 UTC 2012
x86_64 x86_64 x86_64 GNU/Linux
More information about the Haskell-Cafe
mailing list