System.Directory
module provides findFile function which takes list of directories and a file as
an argument and return ‘Just path’ if the file is available, else Nothing.
Following is the signature of findFile function.
Prelude
System.Directory> :t findFile
findFile ::
[FilePath] -> String -> IO (Maybe FilePath)
Prelude System.Directory> findFile ["/", "/Users/harikrishna_gurram", "/var"] "academyLogin.log" Just "/Users/harikrishna_gurram/academyLogin.log" Prelude System.Directory> Prelude System.Directory> findFile ["/", "/Users/harikrishna_gurram", "/var"] "academyLogin.log.123" Nothing
No comments:
Post a Comment