3 module Distribution
.Compat
.Directory
9 #if MIN_VERSION_directory
(1,2,7)
10 import System
.Directory
as Dir
hiding (doesPathExist
)
11 import System
.Directory
(doesPathExist
)
13 import System
.Directory
as Dir
15 #if !MIN_VERSION_directory
(1,2,2)
16 import System
.FilePath as Path
19 #if !MIN_VERSION_directory
(1,2,5)
21 listDirectory
:: FilePath -> IO [FilePath]
23 filter f `
fmap` Dir
.getDirectoryContents path
24 where f filename
= filename
/= "." && filename
/= ".."
28 #if !MIN_VERSION_directory
(1,2,2)
30 makeAbsolute
:: FilePath -> IO FilePath
31 makeAbsolute p | Path
.isAbsolute p
= return p
33 cwd
<- Dir
.getCurrentDirectory
38 #if !MIN_VERSION_directory
(1,2,7)
40 doesPathExist
:: FilePath -> IO Bool
41 doesPathExist path
= do
42 -- not using Applicative, as this way we can do less IO
43 e
<- doesDirectoryExist path
46 else doesFileExist path