Haskell - Checking the Validity of a File Handle

Ok, guys, super easy question (it seems weird that Google didn't help me with this one):

import IO

--.... yadda, yadda, yadda

  file <- openFile "/some/path" ReadMode

How do I check if the handle that I got from openFile is a valid handle, i.e. that the file exists and was opened successfully?

6
задан Don Stewart 4 May 2011 в 16:42
поделиться