MrRalphMan Posted August 1, 2009 Share Posted August 1, 2009 Hi all, I've got a small program that has been written in Haskell and am using the GHC compiler to run it in interactive mode. Basically it runs in a DOS window, but the issue is that it generates more output then the buffer can hold. Now I'm not sure how I can point the output to a file, to capture all the output. Anyone got an idea? Paul. Quote Link to comment Share on other sites More sharing options...
Hermit Posted August 1, 2009 Share Posted August 1, 2009 I've never played with Haskell, but since it's in a DOS window could you redirect the output to a file with '> file' at the end of the command? Like... ghc foo > foo.txt Quote Link to comment Share on other sites More sharing options...
MrRalphMan Posted August 1, 2009 Author Share Posted August 1, 2009 Although it's a DOS window, it's running it's EXE file within it, so that doesn't work.. I open the window from the Start Menu and then load the source file into it, then :main to run it. Quote Link to comment Share on other sites More sharing options...
Hermit Posted August 1, 2009 Share Posted August 1, 2009 Ah, I see. I guess there is a way to run it straight from a command line, but then you wouldn't have debugging. So alternatively, you could set up the redirection at the start of your program. Looking around I found this example, which uses pipes and 'fdToHandle': http://book.realworldhaskell.org/read/systems-programming-in-haskell.html So maybe something like: outfile stdouthdl I'm not sure if there is a function called createFile, or what it's arguments would be, in Haskell, but you can probably guess what I'd expect it to do! Quote Link to comment Share on other sites More sharing options...
MrRalphMan Posted August 1, 2009 Author Share Posted August 1, 2009 Right, sorted this.. whoopy... I compiled it using ghc --make test.hs -o test This created the .exe file, then I just redirected the output of this with the standard DOS command as above. Now all I need to do is run the True Crypt cracking program to hopefully find the password to my TC file. Cheers though. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.