diff --git a/System/Posix/Files.hsc b/System/Posix/Files.hsc index 0810dc74f64d11b12c448d3e611367c8eaa56fba..4243bc3e8ac6cc579fe8498a34813c9a5ed95caa 100644 --- a/System/Posix/Files.hsc +++ b/System/Posix/Files.hsc @@ -66,6 +66,7 @@ module System.Posix.Files ( -- * Extended file status ExtendedFileStatus(..), CAttributes(..), + haveStatx, -- ** Obtaining extended file status getExtendedFileStatus, -- ** Flags diff --git a/System/Posix/Files/ByteString.hsc b/System/Posix/Files/ByteString.hsc index 25327cc19915437af37cb8b70d98347c7de9788f..e9d22e46efe742e768b07245b4996453cf1e9f2f 100644 --- a/System/Posix/Files/ByteString.hsc +++ b/System/Posix/Files/ByteString.hsc @@ -66,6 +66,7 @@ module System.Posix.Files.ByteString ( -- * Extended file status ExtendedFileStatus(..), CAttributes(..), + haveStatx, -- ** Obtaining extended file status getExtendedFileStatus, -- ** Flags diff --git a/System/Posix/Files/Common.hsc b/System/Posix/Files/Common.hsc index 30ac2b2dac00d53c1c31fceeca16c28664e1035d..c0cd6b616de370741bfbfa71e72a30c081008f41 100644 --- a/System/Posix/Files/Common.hsc +++ b/System/Posix/Files/Common.hsc @@ -122,6 +122,7 @@ module System.Posix.Files.Common ( isDirectoryX, isSymbolicLinkX, isSocketX, + haveStatx, -- * Setting file sizes setFdSize, @@ -1346,3 +1347,11 @@ getExtendedFileStatus_ fdMay str (StatxFlags flags) (StatxMask masks) = do getExtendedFileStatus_ _ _ _ _ = ioError (ioeSetLocation unsupportedOperation "getExtendedFileStatus") #endif +-- | Whether 'statx' is available on this platform and 'getExtendedFileStatus' and +-- related functions will work. +haveStatx :: Bool +#ifdef HAVE_STATX +haveStatx = True +#else +haveStatx = False +#endif diff --git a/System/Posix/Files/PosixString.hsc b/System/Posix/Files/PosixString.hsc index 1fdc5d817895b0948449e56a1e91640b1adee640..3466f83b35993705622283110c118b6bc06f0dad 100644 --- a/System/Posix/Files/PosixString.hsc +++ b/System/Posix/Files/PosixString.hsc @@ -62,6 +62,7 @@ module System.Posix.Files.PosixString ( -- * Extended file status ExtendedFileStatus(..), CAttributes(..), + haveStatx, -- ** Obtaining extended file status getExtendedFileStatus, -- ** Flags diff --git a/changelog.md b/changelog.md index 3b741bdece153461aaf3e6ef308cdc6148d21c85..5318270754bf7c9e4c57cc7a22d92b1aa9c6e49b 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,9 @@ # Changelog for [`unix` package](http://hackage.haskell.org/package/unix) +## 2.8.4.0 *??? 2023* + + * add `haveStatx` + ## 2.8.3.0 *Oct 2023* * add `getExtendedFileStatus` (based on `statx`) style functions diff --git a/unix.cabal b/unix.cabal index 8942c17bb73cd0187e8b4266cc64520f6e2afa2e..380b72fd6d3ca20718d1902872da1c834d338f5b 100644 --- a/unix.cabal +++ b/unix.cabal @@ -1,6 +1,6 @@ cabal-version: 1.12 name: unix -version: 2.8.3.0 +version: 2.8.4.0 -- NOTE: Don't forget to update ./changelog.md license: BSD3