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

Module: Directory
Function: doesFileExist
Type: FilePath -> IO Bool
Description: The operation doesFileExist returns True if the argument file exists and is not a directory, and False otherwise.
Related:

Example 1
Program source: 

import IO
import Directory

main = do hdl <- openFile "/tmp/foo.txt" WriteMode
	  hPutStr hdl "Hello"
	  hClose hdl
	  x <- doesFileExist "/tmp/foo.txt"
	  print x
	  y <- doesFileExist "/tmp"
	  print y

Output: True

Output: False