directory 1.3.7.0 → 1.3.7.1
raw patch · 13 files changed
+84/−11 lines, 13 filesdep ~basedep ~filepathdep ~timePVP: major bump suggested
API removals or changes: PVP suggests a major version bump
Dependency ranges changed: base, filepath, time
API changes (from Hackage documentation)
- System.Directory.Internal.Prelude: (.&.) :: Bits a => a -> a -> a
- System.Directory.Internal.Prelude: (.|.) :: Bits a => a -> a -> a
- System.Directory.Internal.Prelude: (<=<) :: Monad m => (b -> m c) -> (a -> m b) -> a -> m c
- System.Directory.Internal.Prelude: (<>) :: Semigroup a => a -> a -> a
- System.Directory.Internal.Prelude: (>=>) :: Monad m => (a -> m b) -> (b -> m c) -> a -> m c
- System.Directory.Internal.Prelude: CInt :: Int32 -> CInt
- System.Directory.Internal.Prelude: CLong :: Int64 -> CLong
- System.Directory.Internal.Prelude: CTime :: Int64 -> CTime
- System.Directory.Internal.Prelude: CUChar :: Word8 -> CUChar
- System.Directory.Internal.Prelude: CULong :: Word64 -> CULong
- System.Directory.Internal.Prelude: CUShort :: Word16 -> CUShort
- System.Directory.Internal.Prelude: CWchar :: Int32 -> CWchar
- System.Directory.Internal.Prelude: InappropriateType :: IOErrorType
- System.Directory.Internal.Prelude: InvalidArgument :: IOErrorType
- System.Directory.Internal.Prelude: OtherError :: IOErrorType
- System.Directory.Internal.Prelude: ReadMode :: IOMode
- System.Directory.Internal.Prelude: UnsupportedOperation :: IOErrorType
- System.Directory.Internal.Prelude: WriteMode :: IOMode
- System.Directory.Internal.Prelude: alignment :: Storable a => a -> Int
- System.Directory.Internal.Prelude: alloca :: Storable a => (Ptr a -> IO b) -> IO b
- System.Directory.Internal.Prelude: allocaArray :: Storable a => Int -> (Ptr a -> IO b) -> IO b
- System.Directory.Internal.Prelude: allocaBytes :: Int -> (Ptr a -> IO b) -> IO b
- System.Directory.Internal.Prelude: allocaBytesAligned :: Int -> Int -> (Ptr a -> IO b) -> IO b
- System.Directory.Internal.Prelude: bracket :: IO a -> (a -> IO b) -> (a -> IO c) -> IO c
- System.Directory.Internal.Prelude: bracket_ :: IO a -> IO b -> IO c -> IO c
- System.Directory.Internal.Prelude: catMaybes :: [Maybe a] -> [a]
- System.Directory.Internal.Prelude: catch :: Exception e => IO a -> (e -> IO a) -> IO a
- System.Directory.Internal.Prelude: catchIOError :: IO a -> (IOError -> IO a) -> IO a
- System.Directory.Internal.Prelude: class Storable a
- System.Directory.Internal.Prelude: complement :: Bits a => a -> a
- System.Directory.Internal.Prelude: data Handle
- System.Directory.Internal.Prelude: data IOErrorType
- System.Directory.Internal.Prelude: data IOMode
- System.Directory.Internal.Prelude: data IORef a
- System.Directory.Internal.Prelude: data Ptr a
- System.Directory.Internal.Prelude: data SomeException
- System.Directory.Internal.Prelude: data Void
- System.Directory.Internal.Prelude: exitFailure :: IO a
- System.Directory.Internal.Prelude: finally :: IO a -> IO b -> IO a
- System.Directory.Internal.Prelude: for :: (Traversable t, Applicative f) => t a -> (a -> f b) -> f (t b)
- System.Directory.Internal.Prelude: for_ :: (Foldable t, Applicative f) => t a -> (a -> f b) -> f ()
- System.Directory.Internal.Prelude: forkFinally :: IO a -> (Either SomeException a -> IO ()) -> IO ThreadId
- System.Directory.Internal.Prelude: forkIO :: IO () -> IO ThreadId
- System.Directory.Internal.Prelude: fromMaybe :: a -> Maybe a -> a
- System.Directory.Internal.Prelude: getArgs :: IO [String]
- System.Directory.Internal.Prelude: getEnv :: String -> IO String
- System.Directory.Internal.Prelude: getFileSystemEncoding :: IO TextEncoding
- System.Directory.Internal.Prelude: hClose :: Handle -> IO ()
- System.Directory.Internal.Prelude: hFlush :: Handle -> IO ()
- System.Directory.Internal.Prelude: hGetBuf :: Handle -> Ptr a -> Int -> IO Int
- System.Directory.Internal.Prelude: hPutBuf :: Handle -> Ptr a -> Int -> IO ()
- System.Directory.Internal.Prelude: hPutStr :: Handle -> String -> IO ()
- System.Directory.Internal.Prelude: hPutStrLn :: Handle -> String -> IO ()
- System.Directory.Internal.Prelude: illegalOperationErrorType :: IOErrorType
- System.Directory.Internal.Prelude: infixl 0 `on`
- System.Directory.Internal.Prelude: infixl 5 .|.
- System.Directory.Internal.Prelude: infixl 7 .&.
- System.Directory.Internal.Prelude: infixr 1 >=>
- System.Directory.Internal.Prelude: infixr 6 <>
- System.Directory.Internal.Prelude: ioeGetErrorString :: IOError -> String
- System.Directory.Internal.Prelude: ioeGetErrorType :: IOError -> IOErrorType
- System.Directory.Internal.Prelude: ioeGetLocation :: IOError -> String
- System.Directory.Internal.Prelude: ioeSetErrorString :: IOError -> String -> IOError
- System.Directory.Internal.Prelude: ioeSetFileName :: IOError -> FilePath -> IOError
- System.Directory.Internal.Prelude: ioeSetLocation :: IOError -> String -> IOError
- System.Directory.Internal.Prelude: isAlpha :: Char -> Bool
- System.Directory.Internal.Prelude: isAlreadyExistsError :: IOError -> Bool
- System.Directory.Internal.Prelude: isAscii :: Char -> Bool
- System.Directory.Internal.Prelude: isDoesNotExistError :: IOError -> Bool
- System.Directory.Internal.Prelude: isIllegalOperation :: IOError -> Bool
- System.Directory.Internal.Prelude: isPermissionError :: IOError -> Bool
- System.Directory.Internal.Prelude: killThread :: ThreadId -> IO ()
- System.Directory.Internal.Prelude: lookupEnv :: String -> IO (Maybe String)
- System.Directory.Internal.Prelude: mask :: ((forall a. () => IO a -> IO a) -> IO b) -> IO b
- System.Directory.Internal.Prelude: maybeToList :: Maybe a -> [a]
- System.Directory.Internal.Prelude: maybeWith :: (a -> (Ptr b -> IO c) -> IO c) -> Maybe a -> (Ptr b -> IO c) -> IO c
- System.Directory.Internal.Prelude: mconcat :: Monoid a => [a] -> a
- System.Directory.Internal.Prelude: mempty :: Monoid a => a
- System.Directory.Internal.Prelude: mkIOError :: IOErrorType -> String -> Maybe Handle -> Maybe FilePath -> IOError
- System.Directory.Internal.Prelude: modifyIOError :: (IOError -> IOError) -> IO a -> IO a
- System.Directory.Internal.Prelude: newEmptyMVar :: IO (MVar a)
- System.Directory.Internal.Prelude: newIORef :: a -> IO (IORef a)
- System.Directory.Internal.Prelude: newtype CInt
- System.Directory.Internal.Prelude: newtype CLong
- System.Directory.Internal.Prelude: newtype CTime
- System.Directory.Internal.Prelude: newtype CUChar
- System.Directory.Internal.Prelude: newtype CULong
- System.Directory.Internal.Prelude: newtype CUShort
- System.Directory.Internal.Prelude: newtype CWchar
- System.Directory.Internal.Prelude: nullPtr :: Ptr a
- System.Directory.Internal.Prelude: on :: (b -> b -> c) -> (a -> b) -> a -> a -> c
- System.Directory.Internal.Prelude: onException :: IO a -> IO b -> IO a
- System.Directory.Internal.Prelude: openBinaryTempFile :: FilePath -> String -> IO (FilePath, Handle)
- System.Directory.Internal.Prelude: peek :: Storable a => Ptr a -> IO a
- System.Directory.Internal.Prelude: peekByteOff :: Storable a => Ptr b -> Int -> IO a
- System.Directory.Internal.Prelude: peekCString :: CString -> IO String
- System.Directory.Internal.Prelude: peekCWStringLen :: CWStringLen -> IO String
- System.Directory.Internal.Prelude: peekElemOff :: Storable a => Ptr a -> Int -> IO a
- System.Directory.Internal.Prelude: permissionErrorType :: IOErrorType
- System.Directory.Internal.Prelude: plusPtr :: Ptr a -> Int -> Ptr b
- System.Directory.Internal.Prelude: poke :: Storable a => Ptr a -> a -> IO ()
- System.Directory.Internal.Prelude: pokeByteOff :: Storable a => Ptr b -> Int -> a -> IO ()
- System.Directory.Internal.Prelude: pokeElemOff :: Storable a => Ptr a -> Int -> a -> IO ()
- System.Directory.Internal.Prelude: putMVar :: MVar a -> a -> IO ()
- System.Directory.Internal.Prelude: readIORef :: IORef a -> IO a
- System.Directory.Internal.Prelude: readMVar :: MVar a -> IO a
- System.Directory.Internal.Prelude: replicateM :: Applicative m => Int -> m a -> m [a]
- System.Directory.Internal.Prelude: replicateM_ :: Applicative m => Int -> m a -> m ()
- System.Directory.Internal.Prelude: second :: Arrow a => a b c -> a (d, b) (d, c)
- System.Directory.Internal.Prelude: sizeOf :: Storable a => a -> Int
- System.Directory.Internal.Prelude: stderr :: Handle
- System.Directory.Internal.Prelude: stdout :: Handle
- System.Directory.Internal.Prelude: takeMVar :: MVar a -> IO a
- System.Directory.Internal.Prelude: throwErrnoIfMinus1Retry_ :: (Eq a, Num a) => String -> IO a -> IO ()
- System.Directory.Internal.Prelude: throwErrnoIfMinus1_ :: (Eq a, Num a) => String -> IO a -> IO ()
- System.Directory.Internal.Prelude: throwErrnoIfNull :: String -> IO (Ptr a) -> IO (Ptr a)
- System.Directory.Internal.Prelude: throwErrnoPathIfMinus1_ :: (Eq a, Num a) => String -> FilePath -> IO a -> IO ()
- System.Directory.Internal.Prelude: throwIO :: Exception e => e -> IO a
- System.Directory.Internal.Prelude: timeout :: Int -> IO a -> IO (Maybe a)
- System.Directory.Internal.Prelude: toLower :: Char -> Char
- System.Directory.Internal.Prelude: toUpper :: Char -> Char
- System.Directory.Internal.Prelude: traverse_ :: (Foldable t, Applicative f) => (a -> f b) -> t a -> f ()
- System.Directory.Internal.Prelude: try :: Exception e => IO a -> IO (Either e a)
- System.Directory.Internal.Prelude: tryIOError :: IO a -> IO (Either IOError a)
- System.Directory.Internal.Prelude: type CString = Ptr CChar
- System.Directory.Internal.Prelude: type CWString = Ptr CWchar
- System.Directory.Internal.Prelude: type EpochTime = CTime
- System.Directory.Internal.Prelude: type IOError = IOException
- System.Directory.Internal.Prelude: unless :: Applicative f => Bool -> f () -> f ()
- System.Directory.Internal.Prelude: userError :: String -> IOError
- System.Directory.Internal.Prelude: when :: Applicative f => Bool -> f () -> f ()
- System.Directory.Internal.Prelude: with :: Storable a => a -> (Ptr a -> IO b) -> IO b
- System.Directory.Internal.Prelude: withArray :: Storable a => [a] -> (Ptr a -> IO b) -> IO b
- System.Directory.Internal.Prelude: withBinaryFile :: FilePath -> IOMode -> (Handle -> IO r) -> IO r
- System.Directory.Internal.Prelude: withCString :: String -> (CString -> IO a) -> IO a
- System.Directory.Internal.Prelude: withCWString :: String -> (CWString -> IO a) -> IO a
- System.Directory.Internal.Prelude: withFilePath :: FilePath -> (CString -> IO a) -> IO a
- System.Directory.Internal.Prelude: writeIORef :: IORef a -> a -> IO ()
Files
- HsDirectoryConfig.h.in +3/−0
- README.md +1/−1
- System/Directory.hs +12/−6
- System/Directory/Internal.hs +1/−0
- System/Directory/Internal/Posix.hsc +9/−0
- System/Directory/Internal/Prelude.hs +1/−0
- changelog.md +6/−0
- configure +7/−0
- configure.ac +1/−0
- directory.cabal +5/−4
- tests/Main.hs +2/−0
- tests/MinimizeNameConflicts.hs +34/−0
- tests/util.inl +2/−0
HsDirectoryConfig.h.in view
@@ -18,6 +18,9 @@ /* Define to 1 if you have the <limits.h> header file. */ #undef HAVE_LIMITS_H +/* Define to 1 if you have the `realpath' function. */+#undef HAVE_REALPATH+ /* Define to 1 if you have the <stdint.h> header file. */ #undef HAVE_STDINT_H
README.md view
@@ -26,5 +26,5 @@ [bi]: https://github.com/haskell/directory/actions/workflows/build.yml/badge.svg [bl]: https://github.com/haskell/directory/actions [di]: https://img.shields.io/hackage-deps/v/directory.svg-[dl]: http://packdeps.haskellers.com/feed?needle=directory+[dl]: http://packdeps.haskellers.com/feed?needle=exact:directory [ac]: https://gnu.org/software/autoconf
System/Directory.hs view
@@ -334,7 +334,7 @@ -- createDirectory (and indeed POSIX mkdir) does not distinguish -- between a dir already existing and a file already existing. So we -- check for it here. Unfortunately there is a slight race condition- -- here, but we think it is benign. It could report an exeption in+ -- here, but we think it is benign. It could report an exception in -- the case that the dir did exist but another process deletes the -- directory and creates a file in its place before we can check -- that the directory did indeed exist.@@ -403,7 +403,7 @@ -- -- On Windows, the operation fails if /dir/ is a directory symbolic link. ----- This operation is reported to be flaky on Windows so retry logic may +-- This operation is reported to be flaky on Windows so retry logic may -- be advisable. See: https://github.com/haskell/directory/pull/108 removeDirectoryRecursive :: FilePath -> IO () removeDirectoryRecursive path =@@ -422,7 +422,7 @@ -- /path/ together with its contents and subdirectories. Symbolic links are -- removed without affecting their the targets. ----- This operation is reported to be flaky on Windows so retry logic may +-- This operation is reported to be flaky on Windows so retry logic may -- be advisable. See: https://github.com/haskell/directory/pull/108 removePathRecursive :: FilePath -> IO () removePathRecursive path =@@ -437,7 +437,7 @@ -- /dir/ recursively. Symbolic links are removed without affecting their the -- targets. ----- This operation is reported to be flaky on Windows so retry logic may +-- This operation is reported to be flaky on Windows so retry logic may -- be advisable. See: https://github.com/haskell/directory/pull/108 removeContentsRecursive :: FilePath -> IO () removeContentsRecursive path =@@ -985,7 +985,7 @@ -- | Search for executable files in a list of system-defined locations, which -- generally includes @PATH@ and possibly more. ----- On Windows, this /only returns the first ocurrence/, if any. Its behavior+-- On Windows, this /only returns the first occurrence/, if any. Its behavior -- is therefore equivalent to 'findExecutable'. -- -- On non-Windows platforms, the behavior is equivalent to@@ -1055,7 +1055,7 @@ -- | @findFilesWith predicate dirs name@ searches through the list of -- directories (@dirs@) for files that have the given @name@ and satisfy the--- given @predicate@ ands return the paths of those files. The directories+-- given @predicate@ and returns the paths of those files. The directories -- are checked in a left-to-right order and the paths are returned in the same -- order. --@@ -1150,6 +1150,12 @@ -- shared among all threads of the process. Therefore, when performing -- filesystem operations from multiple threads, it is highly recommended to -- use absolute rather than relative paths (see: 'makeAbsolute').+--+-- Note that 'getCurrentDirectory' is not guaranteed to return the same path+-- received by 'setCurrentDirectory'. On POSIX systems, the path returned will+-- always be fully dereferenced (not contain any symbolic links). For more+-- information, refer to the documentation of+-- <https://pubs.opengroup.org/onlinepubs/9699919799/functions/getcwd.html getcwd>. -- -- The operation may fail with: --
System/Directory/Internal.hs view
@@ -1,4 +1,5 @@ {-# LANGUAGE CPP #-}+{-# OPTIONS_HADDOCK not-home #-} -- | -- Stability: unstable -- Portability: unportable
System/Directory/Internal/Posix.hsc view
@@ -49,7 +49,16 @@ c_PATH_MAX = Nothing #endif +#if !defined(HAVE_REALPATH)++c_realpath :: CString -> CString -> IO CString+c_realpath _ _ = throwIO (mkIOError UnsupportedOperation "platform does not support realpath" Nothing Nothing)++#else+ foreign import ccall "realpath" c_realpath :: CString -> CString -> IO CString++#endif withRealpath :: CString -> (CString -> IO a) -> IO a withRealpath path action = case c_PATH_MAX of
System/Directory/Internal/Prelude.hs view
@@ -1,4 +1,5 @@ {-# LANGUAGE CPP #-}+{-# OPTIONS_HADDOCK hide #-} -- | -- Stability: unstable -- Portability: portable
changelog.md view
@@ -1,6 +1,12 @@ Changelog for the [`directory`][1] package ========================================== +## 1.3.7.1 (Jul 2022)++ * Relax `time` version bounds to support 1.12.+ * Relax `Win32` version bounds to support 2.13.+ * Relax `base` version bounds to support 4.17.+ ## 1.3.7.0 (Sep 2021) * `getXdgDirectory` now supports `XdgState` (`XDG_STATE_HOME`).
configure view
@@ -3376,6 +3376,13 @@ fi +ac_fn_c_check_func "$LINENO" "realpath" "ac_cv_func_realpath"+if test "x$ac_cv_func_realpath" = xyes+then :+ printf "%s\n" "#define HAVE_REALPATH 1" >>confdefs.h++fi+ ac_fn_c_check_func "$LINENO" "utimensat" "ac_cv_func_utimensat" if test "x$ac_cv_func_utimensat" = xyes then :
configure.ac view
@@ -30,6 +30,7 @@ # check for specific header (.h) files that we are interested in AC_CHECK_HEADERS([fcntl.h limits.h sys/types.h sys/stat.h time.h]) +AC_CHECK_FUNCS([realpath]) AC_CHECK_FUNCS([utimensat]) AC_CHECK_FUNCS([CreateSymbolicLinkW]) AC_CHECK_FUNCS([GetFinalPathNameByHandleW])
directory.cabal view
@@ -1,5 +1,5 @@ name: directory-version: 1.3.7.0+version: 1.3.7.1 license: BSD3 license-file: LICENSE maintainer: libraries@haskell.org@@ -54,11 +54,11 @@ include-dirs: . build-depends:- base >= 4.5 && < 4.17,- time >= 1.4 && < 1.12,+ base >= 4.5 && < 4.18,+ time >= 1.4 && < 1.13, filepath >= 1.3 && < 1.5 if os(windows)- build-depends: Win32 >= 2.2.2 && < 2.13+ build-depends: Win32 >= 2.2.2 && < 2.14 else build-depends: unix >= 2.5.1 && < 2.9 @@ -100,6 +100,7 @@ GetPermissions001 LongPaths MakeAbsolute+ MinimizeNameConflicts PathIsSymbolicLink RemoveDirectoryRecursive001 RemovePathForcibly
tests/Main.hs view
@@ -20,6 +20,7 @@ import qualified GetPermissions001 import qualified LongPaths import qualified MakeAbsolute+import qualified MinimizeNameConflicts import qualified PathIsSymbolicLink import qualified RemoveDirectoryRecursive001 import qualified RemovePathForcibly@@ -54,6 +55,7 @@ T.isolatedRun _t "GetPermissions001" GetPermissions001.main T.isolatedRun _t "LongPaths" LongPaths.main T.isolatedRun _t "MakeAbsolute" MakeAbsolute.main+ T.isolatedRun _t "MinimizeNameConflicts" MinimizeNameConflicts.main T.isolatedRun _t "PathIsSymbolicLink" PathIsSymbolicLink.main T.isolatedRun _t "RemoveDirectoryRecursive001" RemoveDirectoryRecursive001.main T.isolatedRun _t "RemovePathForcibly" RemovePathForcibly.main
+ tests/MinimizeNameConflicts.hs view
@@ -0,0 +1,34 @@+{-# LANGUAGE CPP #-}+module MinimizeNameConflicts+ ( main+ , module System.Directory+#if defined(mingw32_HOST_OS)+ , module System.Win32+#else+ , module System.Posix+#endif+ ) where+#include "util.inl"+#if defined(mingw32_HOST_OS)+import System.Win32 hiding+ ( copyFile+ , createDirectory+ , getCurrentDirectory+ , getTemporaryDirectory+ , removeDirectory+ , setCurrentDirectory+ )+#else+import System.Posix hiding+ ( createDirectory+ , isSymbolicLink+ , removeDirectory+ )+#endif++-- This is just a compile-test to check for name conflicts between directory+-- and other boot libraries. See for example:+-- https://github.com/haskell/directory/issues/52+main :: TestEnv -> IO ()+main _t = do+ T(expect) "no-op" True
tests/util.inl view
@@ -5,3 +5,5 @@ import System.Directory import Util (TestEnv) import qualified Util as T+-- This comment prevents "T" above from being treated as the function-like+-- macro defined earlier.