URGENT: File exists

bracaman@box.sk bracaman@box.sk
Sat, 3 Nov 2001 11:28:30 +0000

I am trying to emulate bash in haskell, and i got a function called shell that waits fot the command and then executes it. The problem is that if the file does not exist, the program returns to Main (it gets out of the shell). The only thing i want to do is to return to the shell after  an IOError. 

How can i perform such a thing?

Thank you,


On Sat, Nov 03, 2001 at 10:56:38AM +0000, bracaman@box.sk wrote:
> I need to create a function that checks if a file exists. My intention is to do something like:
>  teste :: String -> Bool (Beeing the String the FilePath)
> I've tried to use openFile and catch functions, but i couldn't put it working. The purpose of this function
> is to test a file before trying to read it. Example:
> if (test "filepath") then readfile else fail
> Thank you very much for your help,
> Joao
> ------------------------------------
> geek code inside :: powered by linux
> _______________________________________________
> Haskell mailing list
> Haskell@haskell.org
> http://www.haskell.org/mailman/listinfo/haskell

geek code inside :: powered by linux