aboutsummaryrefslogtreecommitdiff
path: root/ch08/8_b_2.txt
blob: 6af6518d33bc2d5f4b3bbdc58d0ab7410afff12c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
-- If you're on a Unix-like system, look through the documentation for the
-- System.Posix.Files module, and see if you can find a replacement for the
-- doesNameExist function.

-- The replacement is the fileExist function that checks for existence of both
-- regular file and directories.

ghci> :module + System.Posix.Files

ghci> fileExist "nonexistent_file"
False

-- Regular file
ghci> fileExist "8_b_2.txt"
True

-- Directory
ghci> fileExist "../ch08/"
True