readFile

bracaman@box.sk bracaman@box.sk
Sun, 4 Nov 2001 22:40:31 +0000


Hello all. It's me again :)

This time I'd like to ask someone to explain me why this happens. I have this piece of code:


test = do writeFile "/tmp/hsout" "first"
           h <- readFile "/tmp/hsout"
	   writeFile "/tmp/hsout" "second"
           putStr h


So, when i've done this i thought that (putStr h) would print the string "first". But it didn't, it printed the string "second".

My question is why? And how can i do to print the first string instead of the first one.


Thank you,

Joćo


------------------------------------
geek code inside :: powered by linux