ZVON > References > Haskell reference
| Indexes | Syntax | Prelude | Ratio | Complex | Numeric | Ix | Array | List | Maybe | Char | Monad | >> IO << | Directory | System | Time | Locale | CPUTime | Random

Module: IO
Function: hIsWritable
Type: Handle -> IO Bool
Description: The functions hIsOpen, hIsClosed, hIsReadable, hIsWritable and hIsSeekable return information about the properties of a handle. Each of these returns True if the handle has the specified property, and False otherwise.
Related:

Example 1
Program source: 

import IO

main = do x <- openFile "/tmp/foo.txt" WriteMode
          y <-hIsWritable x
          print y

Output: True

Example 2
Program source: 

import IO

main = do x <- openFile "/tmp/foo.txt" ReadMode
          y <-hIsWritable x
          print y

Output: False