Thursday, 2 June 2016

Haskell: doesFileExist: Check for file existence

System.Directory module provides doesFileExist function, which return true if the file exist, else false.
Prelude System.Directory> :t doesFileExist 
doesFileExist :: FilePath -> IO Bool
Prelude System.Directory> 
Prelude System.Directory> doesFileExist  "/Users"
False
Prelude System.Directory> doesFileExist  "/Users/harikrishna_gurram/academyLogin.log"
True



Previous                                                 Next                                                 Home

No comments:

Post a Comment