Changeset 10466
- Timestamp:
- 06/03/06 08:12:31 (2 years ago)
- Location:
- src/Pugs
- Files:
-
- 5 modified
-
AST/Internals.hs (modified) (1 diff)
-
Compat.hs (modified) (6 diffs)
-
Internals.hs (modified) (3 diffs)
-
Prim/Eval.hs (modified) (1 diff)
-
Prim/FileTest.hs (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
src/Pugs/AST/Internals.hs
r10323 r10466 1253 1253 mkCompUnit _ pad ast = MkCompUnit compUnitVersion pad ast 1254 1254 1255 compUnitVersion :: Int 1255 1256 compUnitVersion = 1 1256 1257 -
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 -
src/Pugs/Internals.hs
r10113 r10466 1 {-# OPTIONS_GHC -fglasgow-exts -fno-warn-orphans -fno-full-laziness -fno-cse #-}1 {-# OPTIONS_GHC -fglasgow-exts -fno-warn-orphans -fno-full-laziness -fno-cse -fno-warn-deprecations #-} 2 2 3 3 {-| … … 15 15 16 16 module Pugs.Internals ( 17 module UTF8, 17 module Control.Concurrent, 18 module Control.Concurrent.STM, 19 module Control.Exception, 20 module Control.Monad.Error, 21 module Control.Monad.RWS, 22 module Data.Array, 23 module Data.Bits, 24 module Data.Char, 25 module Data.Complex, 26 module Data.Dynamic, 27 module Data.Either, 28 module Data.FunctorM, 29 module Data.IntMap, 30 module Data.List, 31 module Data.Map, 32 module Data.Maybe, 33 module Data.Ratio, 34 module Data.Set, 35 module Data.Tree, 36 module Data.Unique, 37 module Data.Word, 38 module Debug.Trace, 39 module Network, 18 40 module Pugs.Compat, 19 41 module RRegex, 20 42 module RRegex.Syntax, 21 module Data.Char, 22 module Data.Dynamic, 23 module Data.Unique, 24 module Data.FunctorM, 25 module Control.Exception, 43 module System.Cmd, 44 module System.Directory, 26 45 module System.Environment, 27 module System. Random,46 module System.Exit, 28 47 module System.IO, 48 module System.IO.Error, 29 49 module System.IO.Unsafe, 30 module System.IO.Error,31 module System.Exit,32 module System.Time,33 module System.Directory,34 module System.Cmd,35 module System.Process,36 50 module System.Mem, 37 51 module System.Mem.Weak, 38 module Control.Monad.RWS, 39 module Control.Monad.Error, 40 module Control.Concurrent, 41 module Control.Concurrent.STM, 42 module Data.Array, 43 module Data.Bits, 44 module Data.List, 45 module Data.Either, 46 module Data.Word, 47 module Data.Ratio, 48 module Data.Tree, 49 module Data.Maybe, 50 module Data.Complex, 51 module Data.Set, 52 module Data.Map, 53 module Data.IntMap, 54 module Debug.Trace, 55 module Network, 52 module System.Process, 53 module System.Random, 54 module System.Time, 55 module UTF8, 56 56 internalError, 57 57 split, … … 98 98 import System.IO.Unsafe 99 99 import System.IO.Error (ioeGetErrorString, isUserError) 100 import System.Directory101 100 import System.Mem 102 101 import System.Mem.Weak 102 import System.Directory (Permissions(..), getPermissions, getTemporaryDirectory, createDirectory, removeDirectory, removeFile, getDirectoryContents) 103 103 import Control.Exception (catchJust, errorCalls) 104 104 import Control.Monad.RWS -
src/Pugs/Prim/Eval.hs
r10301 r10466 17 17 import Pugs.Config 18 18 import Pugs.Prim.Keyed 19 import qualified Data.ByteString as Str20 19 import DrIFT.YAML 21 20 import Data.Yaml.Syck 22 23 -- type Str = Str.ByteString24 25 21 26 22 data EvalError = EvalErrorFatal -
src/Pugs/Prim/FileTest.hs
r3372 r10466 59 59 60 60 fileTestExists :: FilePath -> IO Val 61 fileTestExists f = do 62 b1 <- doesFileExist f 63 b2 <- doesDirectoryExist f 64 return $ valFromBool f (b1 || b2) 61 fileTestExists f = doesExist f >>= return . (valFromBool f) 65 62 66 63 fileTestIsFile :: FilePath -> IO Val
