Skip to content

Commit 3e7dcbc

Browse files
committed
Add haveStatx
1 parent 83ee24f commit 3e7dcbc

File tree

6 files changed

+17
-1
lines changed

6 files changed

+17
-1
lines changed

System/Posix/Files.hsc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ module System.Posix.Files (
6666
-- * Extended file status
6767
ExtendedFileStatus(..),
6868
CAttributes(..),
69+
haveStatx,
6970
-- ** Obtaining extended file status
7071
getExtendedFileStatus,
7172
-- ** Flags

System/Posix/Files/ByteString.hsc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ module System.Posix.Files.ByteString (
6666
-- * Extended file status
6767
ExtendedFileStatus(..),
6868
CAttributes(..),
69+
haveStatx,
6970
-- ** Obtaining extended file status
7071
getExtendedFileStatus,
7172
-- ** Flags

System/Posix/Files/Common.hsc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ module System.Posix.Files.Common (
122122
isDirectoryX,
123123
isSymbolicLinkX,
124124
isSocketX,
125+
haveStatx,
125126

126127
-- * Setting file sizes
127128
setFdSize,
@@ -1346,3 +1347,11 @@ getExtendedFileStatus_ fdMay str (StatxFlags flags) (StatxMask masks) = do
13461347
getExtendedFileStatus_ _ _ _ _ = ioError (ioeSetLocation unsupportedOperation "getExtendedFileStatus")
13471348
#endif
13481349

1350+
-- | Whether 'statx' is available on this platform and 'getExtendedFileStatus' and
1351+
-- related functions will work.
1352+
haveStatx :: Bool
1353+
#ifdef HAVE_STATX
1354+
haveStatx = True
1355+
#else
1356+
haveStatx = False
1357+
#endif

System/Posix/Files/PosixString.hsc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ module System.Posix.Files.PosixString (
6262
-- * Extended file status
6363
ExtendedFileStatus(..),
6464
CAttributes(..),
65+
haveStatx,
6566
-- ** Obtaining extended file status
6667
getExtendedFileStatus,
6768
-- ** Flags

changelog.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changelog for [`unix` package](http://hackage.haskell.org/package/unix)
22

3+
## 2.8.4.0 *??? 2023*
4+
5+
* add `haveStatx`
6+
37
## 2.8.3.0 *Oct 2023*
48

59
* add `getExtendedFileStatus` (based on `statx`) style functions

unix.cabal

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
cabal-version: 1.12
22
name: unix
3-
version: 2.8.3.0
3+
version: 2.8.4.0
44
-- NOTE: Don't forget to update ./changelog.md
55

66
license: BSD3

0 commit comments

Comments
 (0)