X-Git-Url: http://git.megacz.com/?p=haskell-directory.git;a=blobdiff_plain;f=System%2FDirectory.hs;fp=System%2FDirectory.hs;h=bd05bad4ec7f6357ab99b89f60bee0ded2a958c0;hp=3ed120c972f3caff649b51e66bf0bb044a35eed4;hb=8ba5e95fc14cdaef89980bae2bf5be01fea9757a;hpb=c6d4830abce544d290e5887a18e909a401709996 diff --git a/System/Directory.hs b/System/Directory.hs index 3ed120c..bd05bad 100644 --- a/System/Directory.hs +++ b/System/Directory.hs @@ -21,7 +21,9 @@ module System.Directory -- * Actions on directories createDirectory -- :: FilePath -> IO () +#ifndef __NHC__ , createDirectoryIfMissing -- :: Bool -> FilePath -> IO () +#endif , removeDirectory -- :: FilePath -> IO () , removeDirectoryRecursive -- :: FilePath -> IO () , renameDirectory -- :: FilePath -> FilePath -> IO () @@ -82,9 +84,9 @@ import Control.Monad ( when, unless ) import Control.Exception.Base #ifdef __NHC__ -import Directory hiding ( getDirectoryContents - , doesDirectoryExist, doesFileExist - , getModificationTime ) +import Directory -- hiding ( getDirectoryContents + -- , doesDirectoryExist, doesFileExist + -- , getModificationTime ) import System (system) #endif /* __NHC__ */ @@ -329,6 +331,7 @@ copyPermissions fromFPath toFPath #endif +#ifndef __NHC__ -- | @'createDirectoryIfMissing' parents dir@ creates a new directory -- @dir@ if it doesn\'t exist. If the first argument is 'True' -- the function will also create all parent directories if they are missing. @@ -376,6 +379,7 @@ createDirectoryIfMissing create_parents path0 #endif ) `catch` ((\_ -> return ()) :: IOException -> IO ()) | otherwise -> throw e +#endif /* !__NHC__ */ #if __GLASGOW_HASKELL__ {- | @'removeDirectory' dir@ removes an existing directory /dir/. The @@ -739,7 +743,7 @@ findExecutable binary = #endif -#ifndef __HUGS__ +#ifdef __GLASGOW_HASKELL__ {- |@'getDirectoryContents' dir@ returns a list of /all/ entries in /dir/. @@ -804,7 +808,7 @@ getDirectoryContents path = -- no need to reverse, ordering is undefined #endif /* mingw32 */ -#endif /* !__HUGS__ */ +#endif /* __GLASGOW_HASKELL__ */ {- |If the operating system has a notion of current directories, @@ -883,7 +887,7 @@ setCurrentDirectory path = #endif /* __GLASGOW_HASKELL__ */ -#ifndef __HUGS__ +#ifdef __GLASGOW_HASKELL__ {- |The operation 'doesDirectoryExist' returns 'True' if the argument file exists and is a directory, and 'False' otherwise. -} @@ -937,7 +941,7 @@ getModificationTime name = do #endif -#endif /* !__HUGS__ */ +#endif /* __GLASGOW_HASKELL__ */ #ifdef mingw32_HOST_OS withFileStatus :: String -> FilePath -> (Ptr CStat -> IO a) -> IO a