Changeset 10466 for src/Pugs/Compat.hs
- Timestamp:
- 06/03/06 08:12:31 (3 years ago)
- Files:
-
- 1 modified
-
src/Pugs/Compat.hs (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/Pugs/Compat.hs
r8934 r10466 1 {-# OPTIONS_GHC -fglasgow-exts -fvia-C -optc-w -fno-warn-orphans -cpp #-}1 {-# OPTIONS_GHC -fglasgow-exts -fvia-C -optc-w -fno-warn-orphans -cpp -fno-warn-deprecations #-} 2 2 3 3 {-| … … 43 43 closeDirStream, 44 44 executeFile', -- the prime signifies we changed signature. 45 getCurrentDirectory, 46 setCurrentDirectory, 47 doesFileExist, 48 doesDirectoryExist, 49 doesExist, 45 50 ) where 46 51 … … 49 54 50 55 #ifdef PUGS_HAVE_POSIX 56 import System.Posix.Files 51 57 import System.Posix.Process 52 58 import System.Posix.Env hiding (getEnvironment) 53 import System.Posix.Files54 59 import System.Posix.Directory 55 60 import System.Posix.User … … 61 66 import qualified System.Posix.Signals 62 67 68 doesExist :: FilePath -> IO Bool 69 doesExist = fileExist 70 71 doesFileExist :: FilePath -> IO Bool 72 doesFileExist f = do 73 rv <- (fmap isRegularFile . getFileStatus) f 74 return rv 75 76 doesDirectoryExist :: FilePath -> IO Bool 77 doesDirectoryExist = fmap isDirectory . getFileStatus 78 79 getCurrentDirectory :: IO FilePath 80 getCurrentDirectory = getWorkingDirectory 81 82 setCurrentDirectory :: FilePath -> IO () 83 setCurrentDirectory = changeWorkingDirectory 84 63 85 executeFile' :: FilePath -> Bool -> [String] -> Maybe [(String, String)] -> IO ExitCode 64 86 executeFile' prog search args env = do … … 87 109 import Debug.Trace 88 110 import qualified System.Environment 111 import System.Directory (getCurrentDirectory, setCurrentDirectory, doesFileExist, doesDirectoryExist) 89 112 import IO 90 113 import System.IO … … 245 268 executeFile' _ _ _ _ = failWithIncomplete "executeFile" 246 269 270 doesExist :: FilePath -> IO Bool 271 doesExist f = do 272 rv <- doesFileExist f 273 if rv then return rv else doesDirectoryExist f 274 247 275 #endif 248 276
