Jump to content
The mkiv Supra Owners Club

Wild question - anyone used the GHC compiler before?


MrRalphMan

Recommended Posts

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.

Link to comment
Share on other sites

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!

Link to comment
Share on other sites

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.

 

:)

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. You might also be interested in our Guidelines, Privacy Policy and Terms of Use.