{-# LINE 1 "System/Posix/Files/Common.hsc" #-}{-# LANGUAGE CApiFFI #-}{-# LANGUAGE RecordWildCards #-}{-# LANGUAGE Trustworthy #-}{-# LANGUAGE PatternSynonyms #-}{-# LANGUAGE GeneralizedNewtypeDeriving #-}{-# LANGUAGE NumDecimals #-}------------------------------------------------------------------------------- |-- Module : System.Posix.Files.Common-- Copyright : (c) The University of Glasgow 2002-- License : BSD-style (see the file libraries/base/LICENSE)---- Maintainer : libraries@haskell.org-- Stability : provisional-- Portability : non-portable (requires POSIX)---- Functions defined by the POSIX standards for manipulating and querying the-- file system. Names of underlying POSIX functions are indicated whenever-- possible. A more complete documentation of the POSIX functions together-- with a more detailed description of different error conditions are usually-- available in the system's manual pages or from-- <http://www.unix.org/version3/online.html> (free registration required).---- When a function that calls an underlying POSIX function fails, the errno-- code is converted to an 'IOError' using 'Foreign.C.Error.errnoToIOError'.-- For a list of which errno codes may be generated, consult the POSIX-- documentation for the underlying function.-------------------------------------------------------------------------------moduleSystem.Posix.Files.Common(-- * File modes-- FileMode exported by System.Posix.TypesunionFileModes ,intersectFileModes ,nullFileMode ,ownerReadMode ,ownerWriteMode ,ownerExecuteMode ,ownerModes ,groupReadMode ,groupWriteMode ,groupExecuteMode ,groupModes ,otherReadMode ,otherWriteMode ,otherExecuteMode ,otherModes ,setUserIDMode ,setGroupIDMode ,stdFileMode ,accessModes ,fileTypeModes ,blockSpecialMode ,characterSpecialMode ,namedPipeMode ,regularFileMode ,directoryMode ,symbolicLinkMode ,socketMode ,-- ** Setting file modessetFdMode ,setFileCreationMask ,-- * File statusFileStatus (..),-- ** Obtaining file statusgetFdStatus ,-- ** Querying file statusdeviceID ,fileID ,fileMode ,linkCount ,fileOwner ,fileGroup ,specialDeviceID ,fileSize ,accessTime ,modificationTime ,statusChangeTime ,accessTimeHiRes ,modificationTimeHiRes ,statusChangeTimeHiRes ,setFdTimesHiRes ,touchFd ,isBlockDevice ,isCharacterDevice ,isNamedPipe ,isRegularFile ,isDirectory ,isSymbolicLink ,isSocket ,fileBlockSize ,fileBlocks ,-- * Extended file statusStatxFlags (..),patternEmptyPath ,patternNoAutoMount ,patternSymlinkNoFollow ,patternSyncAsStat ,patternForceSync ,patternDontSync ,defaultStatxFlags ,StatxMask (..),patternStatxType ,patternStatxMode ,patternStatxNlink ,patternStatxUid ,patternStatxGid ,patternStatxAtime ,patternStatxMtime ,patternStatxCtime ,patternStatxBtime ,patternStatxIno ,patternStatxSize ,patternStatxBlocks ,patternStatxMntId ,patternStatxBasicStats ,patternStatxAll ,defaultStatxMask ,ExtendedFileStatus (..),CAttributes (..),getExtendedFileStatus_ ,fileBlockSizeX ,linkCountX ,fileOwnerX ,fileGroupX ,fileModeX ,fileIDX ,fileSizeX ,fileBlocksX ,accessTimeHiResX ,creationTimeHiResX ,statusChangeTimeHiResX ,modificationTimeHiResX ,deviceIDX ,specialDeviceIDX ,mountIDX ,fileCompressedX ,fileImmutableX ,fileAppendX ,fileNoDumpX ,fileEncryptedX ,fileVerityX ,fileDaxX ,isBlockDeviceX ,isCharacterDeviceX ,isNamedPipeX ,isRegularFileX ,isDirectoryX ,isSymbolicLinkX ,isSocketX ,haveStatx ,-- * Setting file sizessetFdSize ,-- * Changing file ownershipsetFdOwnerAndGroup ,-- * Find system-specific limits for a filePathVar (..),getFdPathVar ,pathVarConst ,-- * Low level types and functions{-# LINE 138 "System/Posix/Files/Common.hsc" #-}CTimeSpec(..),toCTimeSpec ,c_utimensat ,{-# LINE 142 "System/Posix/Files/Common.hsc" #-}{-# LINE 147 "System/Posix/Files/Common.hsc" #-}CTimeVal (..),toCTimeVal ,c_utimes ,{-# LINE 151 "System/Posix/Files/Common.hsc" #-}c_lutimes,{-# LINE 153 "System/Posix/Files/Common.hsc" #-})whereimportSystem.Posix.TypesimportSystem.IO.UnsafeimportData.BitsimportData.IntimportData.RatioimportData.Word{-# LINE 162 "System/Posix/Files/Common.hsc" #-}importData.Time.Clock(secondsToNominalDiffTime)importData.Fixed(Fixed(..)){-# LINE 165 "System/Posix/Files/Common.hsc" #-}importData.Time.Clock.POSIX(POSIXTime)importSystem.Posix.InternalsimportForeign.CimportForeign.ForeignPtr{-# LINE 170 "System/Posix/Files/Common.hsc" #-}importForeign.Marshal(withArray){-# LINE 172 "System/Posix/Files/Common.hsc" #-}importForeign.PtrimportForeign.Storable{-# LINE 179 "System/Posix/Files/Common.hsc" #-}-- ------------------------------------------------------------------------------- POSIX file modes-- The abstract type 'FileMode', constants and operators for-- manipulating the file modes defined by POSIX.-- | No permissions.nullFileMode ::FileModenullFileMode :: FileMode nullFileMode =FileMode 0-- | Owner has read permission.ownerReadMode ::FileModeownerReadMode :: FileMode ownerReadMode =(FileMode 256){-# LINE 193 "System/Posix/Files/Common.hsc" #-}-- | Owner has write permission.ownerWriteMode ::FileModeownerWriteMode :: FileMode ownerWriteMode =(FileMode 128){-# LINE 197 "System/Posix/Files/Common.hsc" #-}-- | Owner has execute permission.ownerExecuteMode ::FileModeownerExecuteMode :: FileMode ownerExecuteMode =(FileMode 64){-# LINE 201 "System/Posix/Files/Common.hsc" #-}-- | Group has read permission.groupReadMode ::FileModegroupReadMode :: FileMode groupReadMode =(FileMode 32){-# LINE 205 "System/Posix/Files/Common.hsc" #-}-- | Group has write permission.groupWriteMode ::FileModegroupWriteMode :: FileMode groupWriteMode =(FileMode 16){-# LINE 209 "System/Posix/Files/Common.hsc" #-}-- | Group has execute permission.groupExecuteMode ::FileModegroupExecuteMode :: FileMode groupExecuteMode =(FileMode 8){-# LINE 213 "System/Posix/Files/Common.hsc" #-}-- | Others have read permission.otherReadMode ::FileModeotherReadMode :: FileMode otherReadMode =(FileMode 4){-# LINE 217 "System/Posix/Files/Common.hsc" #-}-- | Others have write permission.otherWriteMode ::FileModeotherWriteMode :: FileMode otherWriteMode =(FileMode 2){-# LINE 221 "System/Posix/Files/Common.hsc" #-}-- | Others have execute permission.otherExecuteMode ::FileModeotherExecuteMode :: FileMode otherExecuteMode =(FileMode 1){-# LINE 225 "System/Posix/Files/Common.hsc" #-}-- | Set user ID on execution.setUserIDMode ::FileModesetUserIDMode :: FileMode setUserIDMode =(FileMode 2048){-# LINE 229 "System/Posix/Files/Common.hsc" #-}-- | Set group ID on execution.setGroupIDMode ::FileModesetGroupIDMode :: FileMode setGroupIDMode =(FileMode 1024){-# LINE 233 "System/Posix/Files/Common.hsc" #-}-- | Owner, group and others have read and write permission.stdFileMode ::FileModestdFileMode :: FileMode stdFileMode =FileMode ownerReadMode FileMode -> FileMode -> FileMode forall a. Bits a => a -> a -> a .|.FileMode ownerWriteMode FileMode -> FileMode -> FileMode forall a. Bits a => a -> a -> a .|.FileMode groupReadMode FileMode -> FileMode -> FileMode forall a. Bits a => a -> a -> a .|.FileMode groupWriteMode FileMode -> FileMode -> FileMode forall a. Bits a => a -> a -> a .|.FileMode otherReadMode FileMode -> FileMode -> FileMode forall a. Bits a => a -> a -> a .|.FileMode otherWriteMode -- | Owner has read, write and execute permission.ownerModes ::FileModeownerModes :: FileMode ownerModes =(FileMode 448){-# LINE 243 "System/Posix/Files/Common.hsc" #-}-- | Group has read, write and execute permission.groupModes ::FileModegroupModes :: FileMode groupModes =(FileMode 56){-# LINE 247 "System/Posix/Files/Common.hsc" #-}-- | Others have read, write and execute permission.otherModes ::FileModeotherModes :: FileMode otherModes =(FileMode 7){-# LINE 251 "System/Posix/Files/Common.hsc" #-}-- | Owner, group and others have read, write and execute permission.accessModes ::FileModeaccessModes :: FileMode accessModes =FileMode ownerModes FileMode -> FileMode -> FileMode forall a. Bits a => a -> a -> a .|.FileMode groupModes FileMode -> FileMode -> FileMode forall a. Bits a => a -> a -> a .|.FileMode otherModes -- | Combines the two file modes into one that contains modes that appear in-- either.unionFileModes ::FileMode->FileMode->FileModeunionFileModes :: FileMode -> FileMode -> FileMode unionFileModes FileMode m1 FileMode m2 =FileMode m1 FileMode -> FileMode -> FileMode forall a. Bits a => a -> a -> a .|.FileMode m2 -- | Combines two file modes into one that only contains modes that appear in-- both.intersectFileModes ::FileMode->FileMode->FileModeintersectFileModes :: FileMode -> FileMode -> FileMode intersectFileModes FileMode m1 FileMode m2 =FileMode m1 FileMode -> FileMode -> FileMode forall a. Bits a => a -> a -> a .&.FileMode m2 fileTypeModes ::FileModefileTypeModes :: FileMode fileTypeModes =(FileMode 61440){-# LINE 268 "System/Posix/Files/Common.hsc" #-}blockSpecialMode ::FileModeblockSpecialMode :: FileMode blockSpecialMode =(FileMode 24576){-# LINE 271 "System/Posix/Files/Common.hsc" #-}characterSpecialMode ::FileModecharacterSpecialMode :: FileMode characterSpecialMode =(FileMode 8192){-# LINE 274 "System/Posix/Files/Common.hsc" #-}namedPipeMode ::FileModenamedPipeMode :: FileMode namedPipeMode =(FileMode 4096){-# LINE 277 "System/Posix/Files/Common.hsc" #-}regularFileMode ::FileModeregularFileMode :: FileMode regularFileMode =(FileMode 32768){-# LINE 280 "System/Posix/Files/Common.hsc" #-}directoryMode ::FileModedirectoryMode :: FileMode directoryMode =(FileMode 16384){-# LINE 283 "System/Posix/Files/Common.hsc" #-}symbolicLinkMode ::FileModesymbolicLinkMode :: FileMode symbolicLinkMode =(FileMode 40960){-# LINE 286 "System/Posix/Files/Common.hsc" #-}socketMode ::FileModesocketMode :: FileMode socketMode =(FileMode 49152){-# LINE 289 "System/Posix/Files/Common.hsc" #-}{-# LINE 291 "System/Posix/Files/Common.hsc" #-}-- | @setFdMode fd mode@ acts like 'setFileMode' but uses a file descriptor-- @fd@ instead of a 'FilePath'.---- Note: calls @fchmod@.setFdMode ::Fd->FileMode->IO()setFdMode :: Fd -> FileMode -> IO () setFdMode (FdCInt fd )FileMode m =String -> IO CInt -> IO () forall a. (Eq a, Num a) => String -> IO a -> IO () throwErrnoIfMinus1_String "setFdMode"(CInt -> FileMode -> IO CInt c_fchmod CInt fd FileMode m )foreignimportccallunsafe"fchmod"c_fchmod ::CInt->CMode->IOCInt{-# LINE 310 "System/Posix/Files/Common.hsc" #-}-- | @setFileCreationMask mode@ sets the file mode creation mask to @mode@.-- Modes set by this operation are subtracted from files and directories upon-- creation. The previous file creation mask is returned.---- Note: calls @umask@.setFileCreationMask ::FileMode->IOFileModesetFileCreationMask :: FileMode -> IO FileMode setFileCreationMask FileMode mask =FileMode -> IO FileMode c_umaskFileMode mask -- ------------------------------------------------------------------------------- stat() support-- | POSIX defines operations to get information, such as owner, permissions,-- size and access times, about a file. This information is represented by the-- 'FileStatus' type.---- Note: see @chmod@.---- Limitations: Support for high resolution timestamps is filesystem dependent:---- - HFS+ volumes on OS X only support whole-second times.--newtypeFileStatus =FileStatus (ForeignPtrCStat)-- ^ The constructor is considered internal and may change.-- | ID of the device on which this file resides.deviceID ::FileStatus ->DeviceID-- | inode numberfileID ::FileStatus ->FileID-- | File mode (such as permissions).fileMode ::FileStatus ->FileMode-- | Number of hard links to this file.linkCount ::FileStatus ->LinkCount-- | ID of owner.fileOwner ::FileStatus ->UserID-- | ID of group.fileGroup ::FileStatus ->GroupID-- | Describes the device that this file represents.specialDeviceID ::FileStatus ->DeviceID-- | Size of the file in bytes. If this file is a symbolic link the size is-- the length of the pathname it contains.fileSize ::FileStatus ->FileOffset-- | Number of blocks allocated for this file, in units of-- 512-bytes. Returns @Nothing@ if @st_blocks@ is not supported on this-- platform.fileBlocks ::FileStatus ->MaybeCBlkCnt-- | Gives the preferred block size for efficient filesystem I/O in-- bytes. Returns @Nothing@ if @st_blocksize@ is not supported on this-- platform.fileBlockSize ::FileStatus ->MaybeCBlkSize-- | Time of last access.accessTime ::FileStatus ->EpochTime-- | Time of last access in sub-second resolution. Depends on the timestamp resolution of the-- underlying filesystem.accessTimeHiRes ::FileStatus ->POSIXTime-- | Time of last modification.modificationTime ::FileStatus ->EpochTime-- | Time of last modification in sub-second resolution. Depends on the timestamp resolution of the-- underlying filesystem.modificationTimeHiRes ::FileStatus ->POSIXTime-- | Time of last status change (i.e. owner, group, link count, mode, etc.).statusChangeTime ::FileStatus ->EpochTime-- | Time of last status change (i.e. owner, group, link count, mode, etc.) in sub-second resolution.-- Depends on the timestamp resolution of the underlying filesystem.statusChangeTimeHiRes ::FileStatus ->POSIXTimedeviceID :: FileStatus -> DeviceID deviceID (FileStatus ForeignPtr CStat stat )=IO DeviceID -> DeviceID forall a. IO a -> a unsafePerformIO(IO DeviceID -> DeviceID) -> IO DeviceID -> DeviceID forall a b. (a -> b) -> a -> b $ForeignPtr CStat -> (Ptr CStat -> IO DeviceID) -> IO DeviceID forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b withForeignPtrForeignPtr CStat stat ((Ptr CStat -> IO DeviceID) -> IO DeviceID) -> (Ptr CStat -> IO DeviceID) -> IO DeviceID forall a b. (a -> b) -> a -> b $((\Ptr CStat hsc_ptr ->Ptr CStat -> Int -> IO DeviceID forall b. Ptr b -> Int -> IO DeviceID forall a b. Storable a => Ptr b -> Int -> IO a peekByteOffPtr CStat hsc_ptr Int 0)){-# LINE 377 "System/Posix/Files/Common.hsc" #-}fileID(FileStatusstat)=unsafePerformIO$withForeignPtrstat$((\hsc_ptr->peekByteOffhsc_ptr8))fileMode :: FileStatus -> FileMode {-# LINE 379 "System/Posix/Files/Common.hsc" #-} fileMode(FileStatusstat)=unsafePerformIO$withForeignPtrstat$((\hsc_ptr->peekByteOffhsc_ptr24)){-# LINE 381 "System/Posix/Files/Common.hsc" #-}linkCount(FileStatusstat)=unsafePerformIO$withForeignPtrstat$((\hsc_ptr->peekByteOffhsc_ptr16)){-# LINE 383 "System/Posix/Files/Common.hsc" #-}fileOwner(FileStatusstat)=unsafePerformIO$withForeignPtrstat$((\hsc_ptr->peekByteOffhsc_ptr28)){-# LINE 385 "System/Posix/Files/Common.hsc" #-}fileGroup(FileStatusstat)=unsafePerformIO$withForeignPtrstat$((\hsc_ptr->peekByteOffhsc_ptr32)){-# LINE 387 "System/Posix/Files/Common.hsc" #-}specialDeviceID(FileStatusstat)=unsafePerformIO$withForeignPtrstat$((\hsc_ptr->peekByteOffhsc_ptr40))fileSize :: FileStatus -> FileOffset {-# LINE 389 "System/Posix/Files/Common.hsc" #-} fileSize(FileStatusstat)=unsafePerformIO$withForeignPtrstat$((\hsc_ptr->peekByteOffhsc_ptr48)){-# LINE 391 "System/Posix/Files/Common.hsc" #-}accessTime(FileStatusstat)=unsafePerformIO$withForeignPtrstat$((\hsc_ptr->peekByteOffhsc_ptr72)){-# LINE 393 "System/Posix/Files/Common.hsc" #-}modificationTime(FileStatusstat)=unsafePerformIO$withForeignPtrstat$((\hsc_ptr->peekByteOffhsc_ptr88)){-# LINE 395 "System/Posix/Files/Common.hsc" #-}statusChangeTime(FileStatusstat)=unsafePerformIO$withForeignPtrstat$((\hsc_ptr->peekByteOffhsc_ptr104)){-# LINE 397 "System/Posix/Files/Common.hsc" #-}{-# LINE 399 "System/Posix/Files/Common.hsc" #-}fileBlocks(FileStatusstat)=Just$unsafePerformIO$withForeignPtrstat$((\hsc_ptr->peekByteOffhsc_ptr64)){-# LINE 401 "System/Posix/Files/Common.hsc" #-}{-# LINE 404 "System/Posix/Files/Common.hsc" #-}{-# LINE 405 "System/Posix/Files/Common.hsc" #-}fileBlockSize(FileStatusstat)=Just$unsafePerformIO$withForeignPtrstat$((\hsc_ptr->peekByteOffhsc_ptr56)){-# LINE 407 "System/Posix/Files/Common.hsc" #-}{-# LINE 410 "System/Posix/Files/Common.hsc" #-}accessTimeHiRes :: FileStatus -> POSIXTime accessTimeHiRes (FileStatus ForeignPtr CStat stat )=IO POSIXTime -> POSIXTime forall a. IO a -> a unsafePerformIO(IO POSIXTime -> POSIXTime) -> IO POSIXTime -> POSIXTime forall a b. (a -> b) -> a -> b $ForeignPtr CStat -> (Ptr CStat -> IO POSIXTime) -> IO POSIXTime forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b withForeignPtrForeignPtr CStat stat ((Ptr CStat -> IO POSIXTime) -> IO POSIXTime) -> (Ptr CStat -> IO POSIXTime) -> IO POSIXTime forall a b. (a -> b) -> a -> b $\Ptr CStat stat_ptr ->doEpochTime sec <-((\Ptr CStat hsc_ptr ->Ptr CStat -> Int -> IO EpochTime forall b. Ptr b -> Int -> IO EpochTime forall a b. Storable a => Ptr b -> Int -> IO a peekByteOffPtr CStat hsc_ptr Int 72))Ptr CStat stat_ptr ::IOEpochTime{-# LINE 414 "System/Posix/Files/Common.hsc" #-}{-# LINE 415 "System/Posix/Files/Common.hsc" #-}nsec<-((\hsc_ptr->peekByteOffhsc_ptr80))stat_ptr::IO(Int64){-# LINE 416 "System/Posix/Files/Common.hsc" #-}letfrac=toIntegernsec%10^(9::Int){-# LINE 432 "System/Posix/Files/Common.hsc" #-}POSIXTime -> IO POSIXTime forall a. a -> IO a forall (m :: * -> *) a. Monad m => a -> m a return(POSIXTime -> IO POSIXTime) -> POSIXTime -> IO POSIXTime forall a b. (a -> b) -> a -> b $Rational -> POSIXTime forall a. Fractional a => Rational -> a fromRational(Rational -> POSIXTime) -> Rational -> POSIXTime forall a b. (a -> b) -> a -> b $EpochTime -> Rational forall a. Real a => a -> Rational toRationalEpochTime sec Rational -> Rational -> Rational forall a. Num a => a -> a -> a +Rational frac modificationTimeHiRes :: FileStatus -> POSIXTime modificationTimeHiRes (FileStatus ForeignPtr CStat stat )=IO POSIXTime -> POSIXTime forall a. IO a -> a unsafePerformIO(IO POSIXTime -> POSIXTime) -> IO POSIXTime -> POSIXTime forall a b. (a -> b) -> a -> b $ForeignPtr CStat -> (Ptr CStat -> IO POSIXTime) -> IO POSIXTime forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b withForeignPtrForeignPtr CStat stat ((Ptr CStat -> IO POSIXTime) -> IO POSIXTime) -> (Ptr CStat -> IO POSIXTime) -> IO POSIXTime forall a b. (a -> b) -> a -> b $\Ptr CStat stat_ptr ->doEpochTime sec <-((\Ptr CStat hsc_ptr ->Ptr CStat -> Int -> IO EpochTime forall b. Ptr b -> Int -> IO EpochTime forall a b. Storable a => Ptr b -> Int -> IO a peekByteOffPtr CStat hsc_ptr Int 88))Ptr CStat stat_ptr ::IOEpochTime{-# LINE 437 "System/Posix/Files/Common.hsc" #-}{-# LINE 438 "System/Posix/Files/Common.hsc" #-}nsec<-((\hsc_ptr->peekByteOffhsc_ptr96))stat_ptr::IO(Int64){-# LINE 439 "System/Posix/Files/Common.hsc" #-}letfrac=toIntegernsec%10^(9::Int){-# LINE 455 "System/Posix/Files/Common.hsc" #-}POSIXTime -> IO POSIXTime forall a. a -> IO a forall (m :: * -> *) a. Monad m => a -> m a return(POSIXTime -> IO POSIXTime) -> POSIXTime -> IO POSIXTime forall a b. (a -> b) -> a -> b $Rational -> POSIXTime forall a. Fractional a => Rational -> a fromRational(Rational -> POSIXTime) -> Rational -> POSIXTime forall a b. (a -> b) -> a -> b $EpochTime -> Rational forall a. Real a => a -> Rational toRationalEpochTime sec Rational -> Rational -> Rational forall a. Num a => a -> a -> a +Rational frac statusChangeTimeHiRes :: FileStatus -> POSIXTime statusChangeTimeHiRes (FileStatus ForeignPtr CStat stat )=IO POSIXTime -> POSIXTime forall a. IO a -> a unsafePerformIO(IO POSIXTime -> POSIXTime) -> IO POSIXTime -> POSIXTime forall a b. (a -> b) -> a -> b $ForeignPtr CStat -> (Ptr CStat -> IO POSIXTime) -> IO POSIXTime forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b withForeignPtrForeignPtr CStat stat ((Ptr CStat -> IO POSIXTime) -> IO POSIXTime) -> (Ptr CStat -> IO POSIXTime) -> IO POSIXTime forall a b. (a -> b) -> a -> b $\Ptr CStat stat_ptr ->doEpochTime sec <-((\Ptr CStat hsc_ptr ->Ptr CStat -> Int -> IO EpochTime forall b. Ptr b -> Int -> IO EpochTime forall a b. Storable a => Ptr b -> Int -> IO a peekByteOffPtr CStat hsc_ptr Int 104))Ptr CStat stat_ptr ::IOEpochTime{-# LINE 460 "System/Posix/Files/Common.hsc" #-}{-# LINE 461 "System/Posix/Files/Common.hsc" #-}nsec<-((\hsc_ptr->peekByteOffhsc_ptr112))stat_ptr::IO(Int64){-# LINE 462 "System/Posix/Files/Common.hsc" #-}letfrac=toIntegernsec%10^(9::Int){-# LINE 478 "System/Posix/Files/Common.hsc" #-}POSIXTime -> IO POSIXTime forall a. a -> IO a forall (m :: * -> *) a. Monad m => a -> m a return(POSIXTime -> IO POSIXTime) -> POSIXTime -> IO POSIXTime forall a b. (a -> b) -> a -> b $Rational -> POSIXTime forall a. Fractional a => Rational -> a fromRational(Rational -> POSIXTime) -> Rational -> POSIXTime forall a b. (a -> b) -> a -> b $EpochTime -> Rational forall a. Real a => a -> Rational toRationalEpochTime sec Rational -> Rational -> Rational forall a. Num a => a -> a -> a +Rational frac -- | Checks if this file is a block device.isBlockDevice ::FileStatus ->Bool-- | Checks if this file is a character device.isCharacterDevice ::FileStatus ->Bool-- | Checks if this file is a named pipe device.isNamedPipe ::FileStatus ->Bool-- | Checks if this file is a regular file device.isRegularFile ::FileStatus ->Bool-- | Checks if this file is a directory device.isDirectory ::FileStatus ->Bool-- | Checks if this file is a symbolic link device.isSymbolicLink ::FileStatus ->Bool-- | Checks if this file is a socket device.isSocket ::FileStatus ->BoolisBlockDevice :: FileStatus -> Bool isBlockDevice FileStatus stat =(FileStatus -> FileMode fileMode FileStatus stat FileMode -> FileMode -> FileMode `intersectFileModes` FileMode fileTypeModes )FileMode -> FileMode -> Bool forall a. Eq a => a -> a -> Bool ==FileMode blockSpecialMode isCharacterDevice :: FileStatus -> Bool isCharacterDevice FileStatus stat =(FileStatus -> FileMode fileMode FileStatus stat FileMode -> FileMode -> FileMode `intersectFileModes` FileMode fileTypeModes )FileMode -> FileMode -> Bool forall a. Eq a => a -> a -> Bool ==FileMode characterSpecialMode isNamedPipe :: FileStatus -> Bool isNamedPipe FileStatus stat =(FileStatus -> FileMode fileMode FileStatus stat FileMode -> FileMode -> FileMode `intersectFileModes` FileMode fileTypeModes )FileMode -> FileMode -> Bool forall a. Eq a => a -> a -> Bool ==FileMode namedPipeMode isRegularFile :: FileStatus -> Bool isRegularFile FileStatus stat =(FileStatus -> FileMode fileMode FileStatus stat FileMode -> FileMode -> FileMode `intersectFileModes` FileMode fileTypeModes )FileMode -> FileMode -> Bool forall a. Eq a => a -> a -> Bool ==FileMode regularFileMode isDirectory :: FileStatus -> Bool isDirectory FileStatus stat =(FileStatus -> FileMode fileMode FileStatus stat FileMode -> FileMode -> FileMode `intersectFileModes` FileMode fileTypeModes )FileMode -> FileMode -> Bool forall a. Eq a => a -> a -> Bool ==FileMode directoryMode isSymbolicLink :: FileStatus -> Bool isSymbolicLink FileStatus stat =(FileStatus -> FileMode fileMode FileStatus stat FileMode -> FileMode -> FileMode `intersectFileModes` FileMode fileTypeModes )FileMode -> FileMode -> Bool forall a. Eq a => a -> a -> Bool ==FileMode symbolicLinkMode isSocket :: FileStatus -> Bool isSocket FileStatus stat =(FileStatus -> FileMode fileMode FileStatus stat FileMode -> FileMode -> FileMode `intersectFileModes` FileMode fileTypeModes )FileMode -> FileMode -> Bool forall a. Eq a => a -> a -> Bool ==FileMode socketMode -- | @getFdStatus fd@ acts as 'getFileStatus' but uses a file descriptor @fd@.---- Note: calls @fstat@.getFdStatus ::Fd->IOFileStatus getFdStatus :: Fd -> IO FileStatus getFdStatus (FdCInt fd )=doForeignPtr CStat fp <-Int -> IO (ForeignPtr CStat) forall a. Int -> IO (ForeignPtr a) mallocForeignPtrBytes(Int 144){-# LINE 516 "System/Posix/Files/Common.hsc" #-}withForeignPtrfp$\p->throwErrnoIfMinus1_"getFdStatus"(c_fstatfdp)FileStatus -> IO FileStatus forall a. a -> IO a forall (m :: * -> *) a. Monad m => a -> m a return(ForeignPtr CStat -> FileStatus FileStatus ForeignPtr CStat fp )-- ------------------------------------------------------------------------------- Setting file times{-# LINE 524 "System/Posix/Files/Common.hsc" #-}dataCTimeSpec=CTimeSpecEpochTimeCLonginstanceStorableCTimeSpec wheresizeOf :: CTimeSpec -> Int sizeOf CTimeSpec _=(Int 16){-# LINE 528 "System/Posix/Files/Common.hsc" #-}alignment_=alignment(undefined::CInt)poke :: Ptr CTimeSpec -> CTimeSpec -> IO () poke Ptr CTimeSpec p (CTimeSpec EpochTime sec CLong nsec )=do((\Ptr CTimeSpec hsc_ptr ->Ptr CTimeSpec -> Int -> EpochTime -> IO () forall b. Ptr b -> Int -> EpochTime -> IO () forall a b. Storable a => Ptr b -> Int -> a -> IO () pokeByteOffPtr CTimeSpec hsc_ptr Int 0))Ptr CTimeSpec p EpochTime sec {-# LINE 531 "System/Posix/Files/Common.hsc" #-}((\Ptr CTimeSpec hsc_ptr ->Ptr CTimeSpec -> Int -> CLong -> IO () forall b. Ptr b -> Int -> CLong -> IO () forall a b. Storable a => Ptr b -> Int -> a -> IO () pokeByteOffPtr CTimeSpec hsc_ptr Int 8))Ptr CTimeSpec p CLong nsec {-# LINE 532 "System/Posix/Files/Common.hsc" #-}peekp=dosec<-(\hsc_ptr->peekByteOffhsc_ptr0)p{-# LINE 534 "System/Posix/Files/Common.hsc" #-}nsec<-(\hsc_ptr->peekByteOffhsc_ptr8)p{-# LINE 535 "System/Posix/Files/Common.hsc" #-}return$CTimeSpecsecnsectoCTimeSpec ::POSIXTime->CTimeSpec toCTimeSpec :: POSIXTime -> CTimeSpec toCTimeSpec POSIXTime t =EpochTime -> CLong -> CTimeSpec CTimeSpec (Int64 -> EpochTime CTimeInt64 sec )(Rational -> CLong forall b. Integral b => Rational -> b forall a b. (RealFrac a, Integral b) => a -> b truncate(Rational -> CLong) -> Rational -> CLong forall a b. (a -> b) -> a -> b $Rational 10Rational -> Int -> Rational forall a b. (Num a, Integral b) => a -> b -> a ^(Int 9::Int)Rational -> Rational -> Rational forall a. Num a => a -> a -> a *Rational frac )where(Int64 sec ,Rational frac )=if(Rational frac' Rational -> Rational -> Bool forall a. Ord a => a -> a -> Bool <Rational 0)then(Int64 sec' Int64 -> Int64 -> Int64 forall a. Num a => a -> a -> a -Int64 1,Rational frac' Rational -> Rational -> Rational forall a. Num a => a -> a -> a +Rational 1)else(Int64 sec' ,Rational frac' )(Int64 sec' ,Rational frac' )=Rational -> (Int64, Rational) forall b. Integral b => Rational -> (b, Rational) forall a b. (RealFrac a, Integral b) => a -> (b, a) properFraction(Rational -> (Int64, Rational)) -> Rational -> (Int64, Rational) forall a b. (a -> b) -> a -> b $POSIXTime -> Rational forall a. Real a => a -> Rational toRationalPOSIXTime t {-# LINE 543 "System/Posix/Files/Common.hsc" #-}{-# LINE 545 "System/Posix/Files/Common.hsc" #-}foreignimportcapiunsafe"sys/stat.h utimensat"c_utimensat::CInt->CString->PtrCTimeSpec->CInt->IOCInt{-# LINE 548 "System/Posix/Files/Common.hsc" #-}{-# LINE 550 "System/Posix/Files/Common.hsc" #-}foreignimportcapiunsafe"sys/stat.h futimens"c_futimens::CInt->PtrCTimeSpec->IOCInt{-# LINE 553 "System/Posix/Files/Common.hsc" #-}dataCTimeVal =CTimeVal (Int64)(Int64){-# LINE 555 "System/Posix/Files/Common.hsc" #-}instanceStorableCTimeVal wheresizeOf :: CTimeVal -> Int sizeOfCTimeVal _=(Int 16){-# LINE 558 "System/Posix/Files/Common.hsc" #-}alignment_=alignment(undefined::CInt)poke :: Ptr CTimeVal -> CTimeVal -> IO () pokePtr CTimeVal p (CTimeVal Int64 sec Int64 usec )=do((\Ptr CTimeVal hsc_ptr ->Ptr CTimeVal -> Int -> Int64 -> IO () forall b. Ptr b -> Int -> Int64 -> IO () forall a b. Storable a => Ptr b -> Int -> a -> IO () pokeByteOffPtr CTimeVal hsc_ptr Int 0))Ptr CTimeVal p Int64 sec {-# LINE 561 "System/Posix/Files/Common.hsc" #-}((\Ptr CTimeVal hsc_ptr ->Ptr CTimeVal -> Int -> Int64 -> IO () forall b. Ptr b -> Int -> Int64 -> IO () forall a b. Storable a => Ptr b -> Int -> a -> IO () pokeByteOffPtr CTimeVal hsc_ptr Int 8))Ptr CTimeVal p Int64 usec {-# LINE 562 "System/Posix/Files/Common.hsc" #-}peekp=dosec<-(\hsc_ptr->peekByteOffhsc_ptr0)p{-# LINE 564 "System/Posix/Files/Common.hsc" #-}usec<-(\hsc_ptr->peekByteOffhsc_ptr8)p{-# LINE 565 "System/Posix/Files/Common.hsc" #-}return$CTimeValsecusectoCTimeVal ::POSIXTime->CTimeVal toCTimeVal :: POSIXTime -> CTimeVal toCTimeVal POSIXTime t =Int64 -> Int64 -> CTimeVal CTimeVal Int64 sec (Rational -> Int64 forall b. Integral b => Rational -> b forall a b. (RealFrac a, Integral b) => a -> b truncate(Rational -> Int64) -> Rational -> Int64 forall a b. (a -> b) -> a -> b $Rational 10Rational -> Int -> Rational forall a b. (Num a, Integral b) => a -> b -> a ^(Int 6::Int)Rational -> Rational -> Rational forall a. Num a => a -> a -> a *Rational frac )where(Int64 sec ,Rational frac )=if(Rational frac' Rational -> Rational -> Bool forall a. Ord a => a -> a -> Bool <Rational 0)then(Int64 sec' Int64 -> Int64 -> Int64 forall a. Num a => a -> a -> a -Int64 1,Rational frac' Rational -> Rational -> Rational forall a. Num a => a -> a -> a +Rational 1)else(Int64 sec' ,Rational frac' )(Int64 sec' ,Rational frac' )=Rational -> (Int64, Rational) forall b. Integral b => Rational -> (b, Rational) forall a b. (RealFrac a, Integral b) => a -> (b, a) properFraction(Rational -> (Int64, Rational)) -> Rational -> (Int64, Rational) forall a b. (a -> b) -> a -> b $POSIXTime -> Rational forall a. Real a => a -> Rational toRationalPOSIXTime t foreignimportcapiunsafe"sys/time.h utimes"c_utimes ::CString->PtrCTimeVal ->IOCInt{-# LINE 577 "System/Posix/Files/Common.hsc" #-}foreignimportcapiunsafe"sys/time.h lutimes"c_lutimes::CString->PtrCTimeVal->IOCInt{-# LINE 580 "System/Posix/Files/Common.hsc" #-}{-# LINE 582 "System/Posix/Files/Common.hsc" #-}foreignimportcapiunsafe"sys/time.h futimes"c_futimes::CInt->PtrCTimeVal->IOCInt{-# LINE 585 "System/Posix/Files/Common.hsc" #-}{-# LINE 594 "System/Posix/Files/Common.hsc" #-}-- | Like 'setFileTimesHiRes' but uses a file descriptor instead of a path.-- This operation is not supported on all platforms. On these platforms,-- this function will raise an exception.---- Note: calls @futimens@ or @futimes@. Support for high resolution timestamps-- is filesystem dependent with the following limitations:---- - HFS+ volumes on OS X truncate the sub-second part of the timestamp.------ @since 2.7.0.0setFdTimesHiRes ::Fd->POSIXTime->POSIXTime->IO(){-# LINE 611 "System/Posix/Files/Common.hsc" #-}setFdTimesHiRes :: Fd -> POSIXTime -> POSIXTime -> IO () setFdTimesHiRes (FdCInt fd )POSIXTime atime POSIXTime mtime =[CTimeSpec] -> (Ptr CTimeSpec -> IO ()) -> IO () forall a b. Storable a => [a] -> (Ptr a -> IO b) -> IO b withArray[POSIXTime -> CTimeSpec toCTimeSpec POSIXTime atime ,POSIXTime -> CTimeSpec toCTimeSpec POSIXTime mtime ]((Ptr CTimeSpec -> IO ()) -> IO ()) -> (Ptr CTimeSpec -> IO ()) -> IO () forall a b. (a -> b) -> a -> b $\Ptr CTimeSpec times ->String -> IO CInt -> IO () forall a. (Eq a, Num a) => String -> IO a -> IO () throwErrnoIfMinus1_String "setFdTimesHiRes"(CInt -> Ptr CTimeSpec -> IO CInt c_futimens CInt fd Ptr CTimeSpec times ){-# LINE 623 "System/Posix/Files/Common.hsc" #-}-- | Like 'touchFile' but uses a file descriptor instead of a path.-- This operation is not supported on all platforms. On these platforms,-- this function will raise an exception.---- Note: calls @futimes@.---- @since 2.7.0.0touchFd ::Fd->IO(){-# LINE 637 "System/Posix/Files/Common.hsc" #-}touchFd :: Fd -> IO () touchFd (FdCInt fd )=String -> IO CInt -> IO () forall a. (Eq a, Num a) => String -> IO a -> IO () throwErrnoIfMinus1_String "touchFd"(CInt -> Ptr CTimeVal -> IO CInt c_futimes CInt fd Ptr CTimeVal forall a. Ptr a nullPtr){-# LINE 644 "System/Posix/Files/Common.hsc" #-}-- ------------------------------------------------------------------------------- fchown(){-# LINE 649 "System/Posix/Files/Common.hsc" #-}-- | Acts as 'setOwnerAndGroup' but uses a file descriptor instead of a-- 'FilePath'.---- Note: calls @fchown@.setFdOwnerAndGroup ::Fd->UserID->GroupID->IO()setFdOwnerAndGroup :: Fd -> UserID -> GroupID -> IO () setFdOwnerAndGroup (FdCInt fd )UserID uid GroupID gid =String -> IO CInt -> IO () forall a. (Eq a, Num a) => String -> IO a -> IO () throwErrnoIfMinus1_String "setFdOwnerAndGroup"(CInt -> UserID -> GroupID -> IO CInt c_fchown CInt fd UserID uid GroupID gid )foreignimportccallunsafe"fchown"c_fchown ::CInt->CUid->CGid->IOCInt{-# LINE 668 "System/Posix/Files/Common.hsc" #-}-- ------------------------------------------------------------------------------- ftruncate()-- | Acts as 'setFileSize' but uses a file descriptor instead of a 'FilePath'.---- Note: calls @ftruncate@.setFdSize ::Fd->FileOffset->IO()setFdSize :: Fd -> FileOffset -> IO () setFdSize (FdCInt fd )FileOffset off =String -> IO CInt -> IO () forall a. (Eq a, Num a) => String -> IO a -> IO () throwErrnoIfMinus1_String "setFdSize"(CInt -> FileOffset -> IO CInt c_ftruncateCInt fd FileOffset off )-- ------------------------------------------------------------------------------- pathconf()/fpathconf() supportdataPathVar =FileSizeBits {- _PC_FILESIZEBITS -}|LinkLimit {- _PC_LINK_MAX -}|InputLineLimit {- _PC_MAX_CANON -}|InputQueueLimit {- _PC_MAX_INPUT -}|FileNameLimit {- _PC_NAME_MAX -}|PathNameLimit {- _PC_PATH_MAX -}|PipeBufferLimit {- _PC_PIPE_BUF -}-- These are described as optional in POSIX:{- _PC_ALLOC_SIZE_MIN -}{- _PC_REC_INCR_XFER_SIZE -}{- _PC_REC_MAX_XFER_SIZE -}{- _PC_REC_MIN_XFER_SIZE -}{- _PC_REC_XFER_ALIGN -}|SymbolicLinkLimit {- _PC_SYMLINK_MAX -}|SetOwnerAndGroupIsRestricted {- _PC_CHOWN_RESTRICTED -}|FileNamesAreNotTruncated {- _PC_NO_TRUNC -}|VDisableChar {- _PC_VDISABLE -}|AsyncIOAvailable {- _PC_ASYNC_IO -}|PrioIOAvailable {- _PC_PRIO_IO -}|SyncIOAvailable {- _PC_SYNC_IO -}pathVarConst ::PathVar ->CIntpathVarConst :: PathVar -> CInt pathVarConst PathVar v =casePathVar v ofPathVar LinkLimit ->(CInt 0){-# LINE 707 "System/Posix/Files/Common.hsc" #-}PathVar InputLineLimit ->(CInt 1){-# LINE 708 "System/Posix/Files/Common.hsc" #-}PathVar InputQueueLimit ->(CInt 2){-# LINE 709 "System/Posix/Files/Common.hsc" #-}PathVar FileNameLimit ->(CInt 3){-# LINE 710 "System/Posix/Files/Common.hsc" #-}PathVar PathNameLimit ->(CInt 4){-# LINE 711 "System/Posix/Files/Common.hsc" #-}PathVar PipeBufferLimit ->(CInt 5){-# LINE 712 "System/Posix/Files/Common.hsc" #-}PathVar SetOwnerAndGroupIsRestricted ->(CInt 6){-# LINE 713 "System/Posix/Files/Common.hsc" #-}PathVar FileNamesAreNotTruncated ->(CInt 7){-# LINE 714 "System/Posix/Files/Common.hsc" #-}PathVar VDisableChar ->(CInt 8){-# LINE 715 "System/Posix/Files/Common.hsc" #-}{-# LINE 717 "System/Posix/Files/Common.hsc" #-}PathVar SyncIOAvailable ->(CInt 9){-# LINE 718 "System/Posix/Files/Common.hsc" #-}{-# LINE 721 "System/Posix/Files/Common.hsc" #-}{-# LINE 723 "System/Posix/Files/Common.hsc" #-}PathVar AsyncIOAvailable ->(CInt 10){-# LINE 724 "System/Posix/Files/Common.hsc" #-}{-# LINE 727 "System/Posix/Files/Common.hsc" #-}{-# LINE 729 "System/Posix/Files/Common.hsc" #-}PathVar PrioIOAvailable ->(CInt 11){-# LINE 730 "System/Posix/Files/Common.hsc" #-}{-# LINE 733 "System/Posix/Files/Common.hsc" #-}{-# LINE 737 "System/Posix/Files/Common.hsc" #-}PathVar FileSizeBits ->String -> CInt forall a. HasCallStack => String -> a errorString "_PC_FILESIZEBITS not available"{-# LINE 739 "System/Posix/Files/Common.hsc" #-}{-# LINE 743 "System/Posix/Files/Common.hsc" #-}PathVar SymbolicLinkLimit ->String -> CInt forall a. HasCallStack => String -> a errorString "_PC_SYMLINK_MAX not available"{-# LINE 745 "System/Posix/Files/Common.hsc" #-}-- | @getFdPathVar var fd@ obtains the dynamic value of the requested-- configurable file limit or option associated with the file or directory-- attached to the open channel @fd@. For defined file limits, @getFdPathVar@-- returns the associated value. For defined file options, the result of-- @getFdPathVar@ is undefined, but not failure.---- Note: calls @fpathconf@.getFdPathVar ::Fd->PathVar ->IOLimitgetFdPathVar :: Fd -> PathVar -> IO CLong getFdPathVar (FdCInt fd )PathVar v =String -> IO CLong -> IO CLong forall a. (Eq a, Num a) => String -> IO a -> IO a throwErrnoIfMinus1String "getFdPathVar"(IO CLong -> IO CLong) -> IO CLong -> IO CLong forall a b. (a -> b) -> a -> b $CInt -> CInt -> IO CLong c_fpathconf CInt fd (PathVar -> CInt pathVarConst PathVar v )foreignimportccallunsafe"fpathconf"c_fpathconf ::CInt->CInt->IOCLong-- ------------------------------------------------------------------------------- statx--newtype{-# CTYPE"__u64"#-}CAttributes =CAttributes Word64deriving(ReadPrec [CAttributes] ReadPrec CAttributes Int -> ReadS CAttributes ReadS [CAttributes] (Int -> ReadS CAttributes) -> ReadS [CAttributes] -> ReadPrec CAttributes -> ReadPrec [CAttributes] -> Read CAttributes forall a. (Int -> ReadS a) -> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a $creadsPrec :: Int -> ReadS CAttributes readsPrec :: Int -> ReadS CAttributes $creadList :: ReadS [CAttributes] readList :: ReadS [CAttributes] $creadPrec :: ReadPrec CAttributes readPrec :: ReadPrec CAttributes $creadListPrec :: ReadPrec [CAttributes] readListPrec :: ReadPrec [CAttributes] Read,Int -> CAttributes -> ShowS [CAttributes] -> ShowS CAttributes -> String (Int -> CAttributes -> ShowS) -> (CAttributes -> String) -> ([CAttributes] -> ShowS) -> Show CAttributes forall a. (Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a $cshowsPrec :: Int -> CAttributes -> ShowS showsPrec :: Int -> CAttributes -> ShowS $cshow :: CAttributes -> String show :: CAttributes -> String $cshowList :: [CAttributes] -> ShowS showList :: [CAttributes] -> ShowS Show,CAttributes -> CAttributes -> Bool (CAttributes -> CAttributes -> Bool) -> (CAttributes -> CAttributes -> Bool) -> Eq CAttributes forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a $c== :: CAttributes -> CAttributes -> Bool == :: CAttributes -> CAttributes -> Bool $c/= :: CAttributes -> CAttributes -> Bool /= :: CAttributes -> CAttributes -> Bool Eq,Eq CAttributes Eq CAttributes => (CAttributes -> CAttributes -> Ordering) -> (CAttributes -> CAttributes -> Bool) -> (CAttributes -> CAttributes -> Bool) -> (CAttributes -> CAttributes -> Bool) -> (CAttributes -> CAttributes -> Bool) -> (CAttributes -> CAttributes -> CAttributes) -> (CAttributes -> CAttributes -> CAttributes) -> Ord CAttributes CAttributes -> CAttributes -> Bool CAttributes -> CAttributes -> Ordering CAttributes -> CAttributes -> CAttributes forall a. Eq a => (a -> a -> Ordering) -> (a -> a -> Bool) -> (a -> a -> Bool) -> (a -> a -> Bool) -> (a -> a -> Bool) -> (a -> a -> a) -> (a -> a -> a) -> Ord a $ccompare :: CAttributes -> CAttributes -> Ordering compare :: CAttributes -> CAttributes -> Ordering $c< :: CAttributes -> CAttributes -> Bool < :: CAttributes -> CAttributes -> Bool $c<= :: CAttributes -> CAttributes -> Bool <= :: CAttributes -> CAttributes -> Bool $c> :: CAttributes -> CAttributes -> Bool > :: CAttributes -> CAttributes -> Bool $c>= :: CAttributes -> CAttributes -> Bool >= :: CAttributes -> CAttributes -> Bool $cmax :: CAttributes -> CAttributes -> CAttributes max :: CAttributes -> CAttributes -> CAttributes $cmin :: CAttributes -> CAttributes -> CAttributes min :: CAttributes -> CAttributes -> CAttributes Ord,Ptr CAttributes -> IO CAttributes Ptr CAttributes -> Int -> IO CAttributes Ptr CAttributes -> Int -> CAttributes -> IO () Ptr CAttributes -> CAttributes -> IO () CAttributes -> Int (CAttributes -> Int) -> (CAttributes -> Int) -> (Ptr CAttributes -> Int -> IO CAttributes) -> (Ptr CAttributes -> Int -> CAttributes -> IO ()) -> (forall b. Ptr b -> Int -> IO CAttributes) -> (forall b. Ptr b -> Int -> CAttributes -> IO ()) -> (Ptr CAttributes -> IO CAttributes) -> (Ptr CAttributes -> CAttributes -> IO ()) -> Storable CAttributes forall b. Ptr b -> Int -> IO CAttributes forall b. Ptr b -> Int -> CAttributes -> IO () forall a. (a -> Int) -> (a -> Int) -> (Ptr a -> Int -> IO a) -> (Ptr a -> Int -> a -> IO ()) -> (forall b. Ptr b -> Int -> IO a) -> (forall b. Ptr b -> Int -> a -> IO ()) -> (Ptr a -> IO a) -> (Ptr a -> a -> IO ()) -> Storable a $csizeOf :: CAttributes -> Int sizeOf :: CAttributes -> Int $calignment :: CAttributes -> Int alignment :: CAttributes -> Int $cpeekElemOff :: Ptr CAttributes -> Int -> IO CAttributes peekElemOff :: Ptr CAttributes -> Int -> IO CAttributes $cpokeElemOff :: Ptr CAttributes -> Int -> CAttributes -> IO () pokeElemOff :: Ptr CAttributes -> Int -> CAttributes -> IO () $cpeekByteOff :: forall b. Ptr b -> Int -> IO CAttributes peekByteOff :: forall b. Ptr b -> Int -> IO CAttributes $cpokeByteOff :: forall b. Ptr b -> Int -> CAttributes -> IO () pokeByteOff :: forall b. Ptr b -> Int -> CAttributes -> IO () $cpeek :: Ptr CAttributes -> IO CAttributes peek :: Ptr CAttributes -> IO CAttributes $cpoke :: Ptr CAttributes -> CAttributes -> IO () poke :: Ptr CAttributes -> CAttributes -> IO () Storable,Integer -> CAttributes CAttributes -> CAttributes CAttributes -> CAttributes -> CAttributes (CAttributes -> CAttributes -> CAttributes) -> (CAttributes -> CAttributes -> CAttributes) -> (CAttributes -> CAttributes -> CAttributes) -> (CAttributes -> CAttributes) -> (CAttributes -> CAttributes) -> (CAttributes -> CAttributes) -> (Integer -> CAttributes) -> Num CAttributes forall a. (a -> a -> a) -> (a -> a -> a) -> (a -> a -> a) -> (a -> a) -> (a -> a) -> (a -> a) -> (Integer -> a) -> Num a $c+ :: CAttributes -> CAttributes -> CAttributes + :: CAttributes -> CAttributes -> CAttributes $c- :: CAttributes -> CAttributes -> CAttributes - :: CAttributes -> CAttributes -> CAttributes $c* :: CAttributes -> CAttributes -> CAttributes * :: CAttributes -> CAttributes -> CAttributes $cnegate :: CAttributes -> CAttributes negate :: CAttributes -> CAttributes $cabs :: CAttributes -> CAttributes abs :: CAttributes -> CAttributes $csignum :: CAttributes -> CAttributes signum :: CAttributes -> CAttributes $cfromInteger :: Integer -> CAttributes fromInteger :: Integer -> CAttributes Num,Eq CAttributes CAttributes Eq CAttributes => (CAttributes -> CAttributes -> CAttributes) -> (CAttributes -> CAttributes -> CAttributes) -> (CAttributes -> CAttributes -> CAttributes) -> (CAttributes -> CAttributes) -> (CAttributes -> Int -> CAttributes) -> (CAttributes -> Int -> CAttributes) -> CAttributes -> (Int -> CAttributes) -> (CAttributes -> Int -> CAttributes) -> (CAttributes -> Int -> CAttributes) -> (CAttributes -> Int -> CAttributes) -> (CAttributes -> Int -> Bool) -> (CAttributes -> Maybe Int) -> (CAttributes -> Int) -> (CAttributes -> Bool) -> (CAttributes -> Int -> CAttributes) -> (CAttributes -> Int -> CAttributes) -> (CAttributes -> Int -> CAttributes) -> (CAttributes -> Int -> CAttributes) -> (CAttributes -> Int -> CAttributes) -> (CAttributes -> Int -> CAttributes) -> (CAttributes -> Int) -> Bits CAttributes Int -> CAttributes CAttributes -> Bool CAttributes -> Int CAttributes -> Maybe Int CAttributes -> CAttributes CAttributes -> Int -> Bool CAttributes -> Int -> CAttributes CAttributes -> CAttributes -> CAttributes forall a. Eq a => (a -> a -> a) -> (a -> a -> a) -> (a -> a -> a) -> (a -> a) -> (a -> Int -> a) -> (a -> Int -> a) -> a -> (Int -> a) -> (a -> Int -> a) -> (a -> Int -> a) -> (a -> Int -> a) -> (a -> Int -> Bool) -> (a -> Maybe Int) -> (a -> Int) -> (a -> Bool) -> (a -> Int -> a) -> (a -> Int -> a) -> (a -> Int -> a) -> (a -> Int -> a) -> (a -> Int -> a) -> (a -> Int -> a) -> (a -> Int) -> Bits a $c.&. :: CAttributes -> CAttributes -> CAttributes .&. :: CAttributes -> CAttributes -> CAttributes $c.|. :: CAttributes -> CAttributes -> CAttributes .|. :: CAttributes -> CAttributes -> CAttributes $cxor :: CAttributes -> CAttributes -> CAttributes xor :: CAttributes -> CAttributes -> CAttributes $ccomplement :: CAttributes -> CAttributes complement :: CAttributes -> CAttributes $cshift :: CAttributes -> Int -> CAttributes shift :: CAttributes -> Int -> CAttributes $crotate :: CAttributes -> Int -> CAttributes rotate :: CAttributes -> Int -> CAttributes $czeroBits :: CAttributes zeroBits :: CAttributes $cbit :: Int -> CAttributes bit :: Int -> CAttributes $csetBit :: CAttributes -> Int -> CAttributes setBit :: CAttributes -> Int -> CAttributes $cclearBit :: CAttributes -> Int -> CAttributes clearBit :: CAttributes -> Int -> CAttributes $ccomplementBit :: CAttributes -> Int -> CAttributes complementBit :: CAttributes -> Int -> CAttributes $ctestBit :: CAttributes -> Int -> Bool testBit :: CAttributes -> Int -> Bool $cbitSizeMaybe :: CAttributes -> Maybe Int bitSizeMaybe :: CAttributes -> Maybe Int $cbitSize :: CAttributes -> Int bitSize :: CAttributes -> Int $cisSigned :: CAttributes -> Bool isSigned :: CAttributes -> Bool $cshiftL :: CAttributes -> Int -> CAttributes shiftL :: CAttributes -> Int -> CAttributes $cunsafeShiftL :: CAttributes -> Int -> CAttributes unsafeShiftL :: CAttributes -> Int -> CAttributes $cshiftR :: CAttributes -> Int -> CAttributes shiftR :: CAttributes -> Int -> CAttributes $cunsafeShiftR :: CAttributes -> Int -> CAttributes unsafeShiftR :: CAttributes -> Int -> CAttributes $crotateL :: CAttributes -> Int -> CAttributes rotateL :: CAttributes -> Int -> CAttributes $crotateR :: CAttributes -> Int -> CAttributes rotateR :: CAttributes -> Int -> CAttributes $cpopCount :: CAttributes -> Int popCount :: CAttributes -> Int Bits)-- | Statx flags.---- See the pattern synonyms for possible flags. These are combined via `(<>)`.-- Flags can be tested via `(.&.)`.---- The following flags influence pathname-based lookup:---- - 'EmptyPath'-- - 'NoAutoMount'-- - 'SymlinkNoFollow'---- The following flags can be used to control what sort of synchronization the kernel will do when querying a file on a remote filesystem:---- - 'SyncAsStat'-- - 'ForceSync'-- - 'DontSync'newtypeStatxFlags =StatxFlags CIntderiving(ReadPrec [StatxFlags] ReadPrec StatxFlags Int -> ReadS StatxFlags ReadS [StatxFlags] (Int -> ReadS StatxFlags) -> ReadS [StatxFlags] -> ReadPrec StatxFlags -> ReadPrec [StatxFlags] -> Read StatxFlags forall a. (Int -> ReadS a) -> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a $creadsPrec :: Int -> ReadS StatxFlags readsPrec :: Int -> ReadS StatxFlags $creadList :: ReadS [StatxFlags] readList :: ReadS [StatxFlags] $creadPrec :: ReadPrec StatxFlags readPrec :: ReadPrec StatxFlags $creadListPrec :: ReadPrec [StatxFlags] readListPrec :: ReadPrec [StatxFlags] Read,Int -> StatxFlags -> ShowS [StatxFlags] -> ShowS StatxFlags -> String (Int -> StatxFlags -> ShowS) -> (StatxFlags -> String) -> ([StatxFlags] -> ShowS) -> Show StatxFlags forall a. (Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a $cshowsPrec :: Int -> StatxFlags -> ShowS showsPrec :: Int -> StatxFlags -> ShowS $cshow :: StatxFlags -> String show :: StatxFlags -> String $cshowList :: [StatxFlags] -> ShowS showList :: [StatxFlags] -> ShowS Show,StatxFlags -> StatxFlags -> Bool (StatxFlags -> StatxFlags -> Bool) -> (StatxFlags -> StatxFlags -> Bool) -> Eq StatxFlags forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a $c== :: StatxFlags -> StatxFlags -> Bool == :: StatxFlags -> StatxFlags -> Bool $c/= :: StatxFlags -> StatxFlags -> Bool /= :: StatxFlags -> StatxFlags -> Bool Eq,Eq StatxFlags Eq StatxFlags => (StatxFlags -> StatxFlags -> Ordering) -> (StatxFlags -> StatxFlags -> Bool) -> (StatxFlags -> StatxFlags -> Bool) -> (StatxFlags -> StatxFlags -> Bool) -> (StatxFlags -> StatxFlags -> Bool) -> (StatxFlags -> StatxFlags -> StatxFlags) -> (StatxFlags -> StatxFlags -> StatxFlags) -> Ord StatxFlags StatxFlags -> StatxFlags -> Bool StatxFlags -> StatxFlags -> Ordering StatxFlags -> StatxFlags -> StatxFlags forall a. Eq a => (a -> a -> Ordering) -> (a -> a -> Bool) -> (a -> a -> Bool) -> (a -> a -> Bool) -> (a -> a -> Bool) -> (a -> a -> a) -> (a -> a -> a) -> Ord a $ccompare :: StatxFlags -> StatxFlags -> Ordering compare :: StatxFlags -> StatxFlags -> Ordering $c< :: StatxFlags -> StatxFlags -> Bool < :: StatxFlags -> StatxFlags -> Bool $c<= :: StatxFlags -> StatxFlags -> Bool <= :: StatxFlags -> StatxFlags -> Bool $c> :: StatxFlags -> StatxFlags -> Bool > :: StatxFlags -> StatxFlags -> Bool $c>= :: StatxFlags -> StatxFlags -> Bool >= :: StatxFlags -> StatxFlags -> Bool $cmax :: StatxFlags -> StatxFlags -> StatxFlags max :: StatxFlags -> StatxFlags -> StatxFlags $cmin :: StatxFlags -> StatxFlags -> StatxFlags min :: StatxFlags -> StatxFlags -> StatxFlags Ord,Enum StatxFlags Real StatxFlags (Real StatxFlags, Enum StatxFlags) => (StatxFlags -> StatxFlags -> StatxFlags) -> (StatxFlags -> StatxFlags -> StatxFlags) -> (StatxFlags -> StatxFlags -> StatxFlags) -> (StatxFlags -> StatxFlags -> StatxFlags) -> (StatxFlags -> StatxFlags -> (StatxFlags, StatxFlags)) -> (StatxFlags -> StatxFlags -> (StatxFlags, StatxFlags)) -> (StatxFlags -> Integer) -> Integral StatxFlags StatxFlags -> Integer StatxFlags -> StatxFlags -> (StatxFlags, StatxFlags) StatxFlags -> StatxFlags -> StatxFlags forall a. (Real a, Enum a) => (a -> a -> a) -> (a -> a -> a) -> (a -> a -> a) -> (a -> a -> a) -> (a -> a -> (a, a)) -> (a -> a -> (a, a)) -> (a -> Integer) -> Integral a $cquot :: StatxFlags -> StatxFlags -> StatxFlags quot :: StatxFlags -> StatxFlags -> StatxFlags $crem :: StatxFlags -> StatxFlags -> StatxFlags rem :: StatxFlags -> StatxFlags -> StatxFlags $cdiv :: StatxFlags -> StatxFlags -> StatxFlags div :: StatxFlags -> StatxFlags -> StatxFlags $cmod :: StatxFlags -> StatxFlags -> StatxFlags mod :: StatxFlags -> StatxFlags -> StatxFlags $cquotRem :: StatxFlags -> StatxFlags -> (StatxFlags, StatxFlags) quotRem :: StatxFlags -> StatxFlags -> (StatxFlags, StatxFlags) $cdivMod :: StatxFlags -> StatxFlags -> (StatxFlags, StatxFlags) divMod :: StatxFlags -> StatxFlags -> (StatxFlags, StatxFlags) $ctoInteger :: StatxFlags -> Integer toInteger :: StatxFlags -> Integer Integral,Integer -> StatxFlags StatxFlags -> StatxFlags StatxFlags -> StatxFlags -> StatxFlags (StatxFlags -> StatxFlags -> StatxFlags) -> (StatxFlags -> StatxFlags -> StatxFlags) -> (StatxFlags -> StatxFlags -> StatxFlags) -> (StatxFlags -> StatxFlags) -> (StatxFlags -> StatxFlags) -> (StatxFlags -> StatxFlags) -> (Integer -> StatxFlags) -> Num StatxFlags forall a. (a -> a -> a) -> (a -> a -> a) -> (a -> a -> a) -> (a -> a) -> (a -> a) -> (a -> a) -> (Integer -> a) -> Num a $c+ :: StatxFlags -> StatxFlags -> StatxFlags + :: StatxFlags -> StatxFlags -> StatxFlags $c- :: StatxFlags -> StatxFlags -> StatxFlags - :: StatxFlags -> StatxFlags -> StatxFlags $c* :: StatxFlags -> StatxFlags -> StatxFlags * :: StatxFlags -> StatxFlags -> StatxFlags $cnegate :: StatxFlags -> StatxFlags negate :: StatxFlags -> StatxFlags $cabs :: StatxFlags -> StatxFlags abs :: StatxFlags -> StatxFlags $csignum :: StatxFlags -> StatxFlags signum :: StatxFlags -> StatxFlags $cfromInteger :: Integer -> StatxFlags fromInteger :: Integer -> StatxFlags Num,Int -> StatxFlags StatxFlags -> Int StatxFlags -> [StatxFlags] StatxFlags -> StatxFlags StatxFlags -> StatxFlags -> [StatxFlags] StatxFlags -> StatxFlags -> StatxFlags -> [StatxFlags] (StatxFlags -> StatxFlags) -> (StatxFlags -> StatxFlags) -> (Int -> StatxFlags) -> (StatxFlags -> Int) -> (StatxFlags -> [StatxFlags]) -> (StatxFlags -> StatxFlags -> [StatxFlags]) -> (StatxFlags -> StatxFlags -> [StatxFlags]) -> (StatxFlags -> StatxFlags -> StatxFlags -> [StatxFlags]) -> Enum StatxFlags forall a. (a -> a) -> (a -> a) -> (Int -> a) -> (a -> Int) -> (a -> [a]) -> (a -> a -> [a]) -> (a -> a -> [a]) -> (a -> a -> a -> [a]) -> Enum a $csucc :: StatxFlags -> StatxFlags succ :: StatxFlags -> StatxFlags $cpred :: StatxFlags -> StatxFlags pred :: StatxFlags -> StatxFlags $ctoEnum :: Int -> StatxFlags toEnum :: Int -> StatxFlags $cfromEnum :: StatxFlags -> Int fromEnum :: StatxFlags -> Int $cenumFrom :: StatxFlags -> [StatxFlags] enumFrom :: StatxFlags -> [StatxFlags] $cenumFromThen :: StatxFlags -> StatxFlags -> [StatxFlags] enumFromThen :: StatxFlags -> StatxFlags -> [StatxFlags] $cenumFromTo :: StatxFlags -> StatxFlags -> [StatxFlags] enumFromTo :: StatxFlags -> StatxFlags -> [StatxFlags] $cenumFromThenTo :: StatxFlags -> StatxFlags -> StatxFlags -> [StatxFlags] enumFromThenTo :: StatxFlags -> StatxFlags -> StatxFlags -> [StatxFlags] Enum,Eq StatxFlags StatxFlags Eq StatxFlags => (StatxFlags -> StatxFlags -> StatxFlags) -> (StatxFlags -> StatxFlags -> StatxFlags) -> (StatxFlags -> StatxFlags -> StatxFlags) -> (StatxFlags -> StatxFlags) -> (StatxFlags -> Int -> StatxFlags) -> (StatxFlags -> Int -> StatxFlags) -> StatxFlags -> (Int -> StatxFlags) -> (StatxFlags -> Int -> StatxFlags) -> (StatxFlags -> Int -> StatxFlags) -> (StatxFlags -> Int -> StatxFlags) -> (StatxFlags -> Int -> Bool) -> (StatxFlags -> Maybe Int) -> (StatxFlags -> Int) -> (StatxFlags -> Bool) -> (StatxFlags -> Int -> StatxFlags) -> (StatxFlags -> Int -> StatxFlags) -> (StatxFlags -> Int -> StatxFlags) -> (StatxFlags -> Int -> StatxFlags) -> (StatxFlags -> Int -> StatxFlags) -> (StatxFlags -> Int -> StatxFlags) -> (StatxFlags -> Int) -> Bits StatxFlags Int -> StatxFlags StatxFlags -> Bool StatxFlags -> Int StatxFlags -> Maybe Int StatxFlags -> StatxFlags StatxFlags -> Int -> Bool StatxFlags -> Int -> StatxFlags StatxFlags -> StatxFlags -> StatxFlags forall a. Eq a => (a -> a -> a) -> (a -> a -> a) -> (a -> a -> a) -> (a -> a) -> (a -> Int -> a) -> (a -> Int -> a) -> a -> (Int -> a) -> (a -> Int -> a) -> (a -> Int -> a) -> (a -> Int -> a) -> (a -> Int -> Bool) -> (a -> Maybe Int) -> (a -> Int) -> (a -> Bool) -> (a -> Int -> a) -> (a -> Int -> a) -> (a -> Int -> a) -> (a -> Int -> a) -> (a -> Int -> a) -> (a -> Int -> a) -> (a -> Int) -> Bits a $c.&. :: StatxFlags -> StatxFlags -> StatxFlags .&. :: StatxFlags -> StatxFlags -> StatxFlags $c.|. :: StatxFlags -> StatxFlags -> StatxFlags .|. :: StatxFlags -> StatxFlags -> StatxFlags $cxor :: StatxFlags -> StatxFlags -> StatxFlags xor :: StatxFlags -> StatxFlags -> StatxFlags $ccomplement :: StatxFlags -> StatxFlags complement :: StatxFlags -> StatxFlags $cshift :: StatxFlags -> Int -> StatxFlags shift :: StatxFlags -> Int -> StatxFlags $crotate :: StatxFlags -> Int -> StatxFlags rotate :: StatxFlags -> Int -> StatxFlags $czeroBits :: StatxFlags zeroBits :: StatxFlags $cbit :: Int -> StatxFlags bit :: Int -> StatxFlags $csetBit :: StatxFlags -> Int -> StatxFlags setBit :: StatxFlags -> Int -> StatxFlags $cclearBit :: StatxFlags -> Int -> StatxFlags clearBit :: StatxFlags -> Int -> StatxFlags $ccomplementBit :: StatxFlags -> Int -> StatxFlags complementBit :: StatxFlags -> Int -> StatxFlags $ctestBit :: StatxFlags -> Int -> Bool testBit :: StatxFlags -> Int -> Bool $cbitSizeMaybe :: StatxFlags -> Maybe Int bitSizeMaybe :: StatxFlags -> Maybe Int $cbitSize :: StatxFlags -> Int bitSize :: StatxFlags -> Int $cisSigned :: StatxFlags -> Bool isSigned :: StatxFlags -> Bool $cshiftL :: StatxFlags -> Int -> StatxFlags shiftL :: StatxFlags -> Int -> StatxFlags $cunsafeShiftL :: StatxFlags -> Int -> StatxFlags unsafeShiftL :: StatxFlags -> Int -> StatxFlags $cshiftR :: StatxFlags -> Int -> StatxFlags shiftR :: StatxFlags -> Int -> StatxFlags $cunsafeShiftR :: StatxFlags -> Int -> StatxFlags unsafeShiftR :: StatxFlags -> Int -> StatxFlags $crotateL :: StatxFlags -> Int -> StatxFlags rotateL :: StatxFlags -> Int -> StatxFlags $crotateR :: StatxFlags -> Int -> StatxFlags rotateR :: StatxFlags -> Int -> StatxFlags $cpopCount :: StatxFlags -> Int popCount :: StatxFlags -> Int Bits,Num StatxFlags Ord StatxFlags (Num StatxFlags, Ord StatxFlags) => (StatxFlags -> Rational) -> Real StatxFlags StatxFlags -> Rational forall a. (Num a, Ord a) => (a -> Rational) -> Real a $ctoRational :: StatxFlags -> Rational toRational :: StatxFlags -> Rational Real)-- | ORs the flags.instanceSemigroupStatxFlags whereStatxFlags a <> :: StatxFlags -> StatxFlags -> StatxFlags <>StatxFlags b =StatxFlags a StatxFlags -> StatxFlags -> StatxFlags forall a. Bits a => a -> a -> a .|.StatxFlags b instanceMonoidStatxFlags wheremappend :: StatxFlags -> StatxFlags -> StatxFlags mappend=StatxFlags -> StatxFlags -> StatxFlags forall a. Semigroup a => a -> a -> a (<>)mempty :: StatxFlags mempty=StatxFlags 0-- | If pathname to 'getExtendedFileStatus' is an empty string, operate on the file referred to by-- the 'Maybe Fd' argument.---- In this case, it can refer to any type of file, not just a directory.patternEmptyPath ::StatxFlags {-# LINE 801 "System/Posix/Files/Common.hsc" #-}patternEmptyPath=StatxFlags(4096){-# LINE 802 "System/Posix/Files/Common.hsc" #-}{-# LINE 805 "System/Posix/Files/Common.hsc" #-}-- | Don't automount the terminal ("basename") component of pathname if it is a directory that is an automount point.-- This allows the caller to gather attributes of an automount point (rather than the location it would mount).-- This flag can be used in tools that scan directories to prevent mass-automounting of a directory of automount points.-- This flag has no effect if the mount point has already been mounted over.patternNoAutoMount ::StatxFlags {-# LINE 812 "System/Posix/Files/Common.hsc" #-}patternNoAutoMount=StatxFlags(2048){-# LINE 813 "System/Posix/Files/Common.hsc" #-}{-# LINE 816 "System/Posix/Files/Common.hsc" #-}-- | If pathname is a symbolic link, do not dereference it: instead return information about the link itself, like @lstat(2)@.patternSymlinkNoFollow ::StatxFlags {-# LINE 820 "System/Posix/Files/Common.hsc" #-}patternSymlinkNoFollow=StatxFlags(256){-# LINE 821 "System/Posix/Files/Common.hsc" #-}{-# LINE 824 "System/Posix/Files/Common.hsc" #-}-- | Do whatever @stat(2)@ does. This is the default and is very much filesystem-specific.patternSyncAsStat ::StatxFlags {-# LINE 828 "System/Posix/Files/Common.hsc" #-}patternSyncAsStat=StatxFlags(0){-# LINE 829 "System/Posix/Files/Common.hsc" #-}{-# LINE 832 "System/Posix/Files/Common.hsc" #-}-- | Force the attributes to be synchronized with the server.-- This may require that a network filesystem perform a data writeback to get the timestamps correct.patternForceSync ::StatxFlags {-# LINE 837 "System/Posix/Files/Common.hsc" #-}patternForceSync=StatxFlags(8192){-# LINE 838 "System/Posix/Files/Common.hsc" #-}{-# LINE 841 "System/Posix/Files/Common.hsc" #-}-- | Don't synchronize anything, but rather just take whatever the system has cached if possible.-- This may mean that the information returned is approximate, but, on a network filesystem,-- it may not involve a round trip to the server - even if no lease is held.patternDontSync ::StatxFlags {-# LINE 847 "System/Posix/Files/Common.hsc" #-}patternDontSync=StatxFlags(16384){-# LINE 848 "System/Posix/Files/Common.hsc" #-}{-# LINE 851 "System/Posix/Files/Common.hsc" #-}defaultStatxFlags ::StatxFlags defaultStatxFlags :: StatxFlags defaultStatxFlags =StatxFlags forall a. Monoid a => a mempty-- | Mask argument to 'statx'. It's used to tell the kernel which fields the caller is interested in.---- See the pattern synonyms for possible masks. These are combined via @(<>)@.-- Masks can be tested via `(.&.)`.newtypeStatxMask =StatxMask CIntderiving(ReadPrec [StatxMask] ReadPrec StatxMask Int -> ReadS StatxMask ReadS [StatxMask] (Int -> ReadS StatxMask) -> ReadS [StatxMask] -> ReadPrec StatxMask -> ReadPrec [StatxMask] -> Read StatxMask forall a. (Int -> ReadS a) -> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a $creadsPrec :: Int -> ReadS StatxMask readsPrec :: Int -> ReadS StatxMask $creadList :: ReadS [StatxMask] readList :: ReadS [StatxMask] $creadPrec :: ReadPrec StatxMask readPrec :: ReadPrec StatxMask $creadListPrec :: ReadPrec [StatxMask] readListPrec :: ReadPrec [StatxMask] Read,Int -> StatxMask -> ShowS [StatxMask] -> ShowS StatxMask -> String (Int -> StatxMask -> ShowS) -> (StatxMask -> String) -> ([StatxMask] -> ShowS) -> Show StatxMask forall a. (Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a $cshowsPrec :: Int -> StatxMask -> ShowS showsPrec :: Int -> StatxMask -> ShowS $cshow :: StatxMask -> String show :: StatxMask -> String $cshowList :: [StatxMask] -> ShowS showList :: [StatxMask] -> ShowS Show,StatxMask -> StatxMask -> Bool (StatxMask -> StatxMask -> Bool) -> (StatxMask -> StatxMask -> Bool) -> Eq StatxMask forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a $c== :: StatxMask -> StatxMask -> Bool == :: StatxMask -> StatxMask -> Bool $c/= :: StatxMask -> StatxMask -> Bool /= :: StatxMask -> StatxMask -> Bool Eq,Eq StatxMask Eq StatxMask => (StatxMask -> StatxMask -> Ordering) -> (StatxMask -> StatxMask -> Bool) -> (StatxMask -> StatxMask -> Bool) -> (StatxMask -> StatxMask -> Bool) -> (StatxMask -> StatxMask -> Bool) -> (StatxMask -> StatxMask -> StatxMask) -> (StatxMask -> StatxMask -> StatxMask) -> Ord StatxMask StatxMask -> StatxMask -> Bool StatxMask -> StatxMask -> Ordering StatxMask -> StatxMask -> StatxMask forall a. Eq a => (a -> a -> Ordering) -> (a -> a -> Bool) -> (a -> a -> Bool) -> (a -> a -> Bool) -> (a -> a -> Bool) -> (a -> a -> a) -> (a -> a -> a) -> Ord a $ccompare :: StatxMask -> StatxMask -> Ordering compare :: StatxMask -> StatxMask -> Ordering $c< :: StatxMask -> StatxMask -> Bool < :: StatxMask -> StatxMask -> Bool $c<= :: StatxMask -> StatxMask -> Bool <= :: StatxMask -> StatxMask -> Bool $c> :: StatxMask -> StatxMask -> Bool > :: StatxMask -> StatxMask -> Bool $c>= :: StatxMask -> StatxMask -> Bool >= :: StatxMask -> StatxMask -> Bool $cmax :: StatxMask -> StatxMask -> StatxMask max :: StatxMask -> StatxMask -> StatxMask $cmin :: StatxMask -> StatxMask -> StatxMask min :: StatxMask -> StatxMask -> StatxMask Ord,Enum StatxMask Real StatxMask (Real StatxMask, Enum StatxMask) => (StatxMask -> StatxMask -> StatxMask) -> (StatxMask -> StatxMask -> StatxMask) -> (StatxMask -> StatxMask -> StatxMask) -> (StatxMask -> StatxMask -> StatxMask) -> (StatxMask -> StatxMask -> (StatxMask, StatxMask)) -> (StatxMask -> StatxMask -> (StatxMask, StatxMask)) -> (StatxMask -> Integer) -> Integral StatxMask StatxMask -> Integer StatxMask -> StatxMask -> (StatxMask, StatxMask) StatxMask -> StatxMask -> StatxMask forall a. (Real a, Enum a) => (a -> a -> a) -> (a -> a -> a) -> (a -> a -> a) -> (a -> a -> a) -> (a -> a -> (a, a)) -> (a -> a -> (a, a)) -> (a -> Integer) -> Integral a $cquot :: StatxMask -> StatxMask -> StatxMask quot :: StatxMask -> StatxMask -> StatxMask $crem :: StatxMask -> StatxMask -> StatxMask rem :: StatxMask -> StatxMask -> StatxMask $cdiv :: StatxMask -> StatxMask -> StatxMask div :: StatxMask -> StatxMask -> StatxMask $cmod :: StatxMask -> StatxMask -> StatxMask mod :: StatxMask -> StatxMask -> StatxMask $cquotRem :: StatxMask -> StatxMask -> (StatxMask, StatxMask) quotRem :: StatxMask -> StatxMask -> (StatxMask, StatxMask) $cdivMod :: StatxMask -> StatxMask -> (StatxMask, StatxMask) divMod :: StatxMask -> StatxMask -> (StatxMask, StatxMask) $ctoInteger :: StatxMask -> Integer toInteger :: StatxMask -> Integer Integral,Integer -> StatxMask StatxMask -> StatxMask StatxMask -> StatxMask -> StatxMask (StatxMask -> StatxMask -> StatxMask) -> (StatxMask -> StatxMask -> StatxMask) -> (StatxMask -> StatxMask -> StatxMask) -> (StatxMask -> StatxMask) -> (StatxMask -> StatxMask) -> (StatxMask -> StatxMask) -> (Integer -> StatxMask) -> Num StatxMask forall a. (a -> a -> a) -> (a -> a -> a) -> (a -> a -> a) -> (a -> a) -> (a -> a) -> (a -> a) -> (Integer -> a) -> Num a $c+ :: StatxMask -> StatxMask -> StatxMask + :: StatxMask -> StatxMask -> StatxMask $c- :: StatxMask -> StatxMask -> StatxMask - :: StatxMask -> StatxMask -> StatxMask $c* :: StatxMask -> StatxMask -> StatxMask * :: StatxMask -> StatxMask -> StatxMask $cnegate :: StatxMask -> StatxMask negate :: StatxMask -> StatxMask $cabs :: StatxMask -> StatxMask abs :: StatxMask -> StatxMask $csignum :: StatxMask -> StatxMask signum :: StatxMask -> StatxMask $cfromInteger :: Integer -> StatxMask fromInteger :: Integer -> StatxMask Num,Int -> StatxMask StatxMask -> Int StatxMask -> [StatxMask] StatxMask -> StatxMask StatxMask -> StatxMask -> [StatxMask] StatxMask -> StatxMask -> StatxMask -> [StatxMask] (StatxMask -> StatxMask) -> (StatxMask -> StatxMask) -> (Int -> StatxMask) -> (StatxMask -> Int) -> (StatxMask -> [StatxMask]) -> (StatxMask -> StatxMask -> [StatxMask]) -> (StatxMask -> StatxMask -> [StatxMask]) -> (StatxMask -> StatxMask -> StatxMask -> [StatxMask]) -> Enum StatxMask forall a. (a -> a) -> (a -> a) -> (Int -> a) -> (a -> Int) -> (a -> [a]) -> (a -> a -> [a]) -> (a -> a -> [a]) -> (a -> a -> a -> [a]) -> Enum a $csucc :: StatxMask -> StatxMask succ :: StatxMask -> StatxMask $cpred :: StatxMask -> StatxMask pred :: StatxMask -> StatxMask $ctoEnum :: Int -> StatxMask toEnum :: Int -> StatxMask $cfromEnum :: StatxMask -> Int fromEnum :: StatxMask -> Int $cenumFrom :: StatxMask -> [StatxMask] enumFrom :: StatxMask -> [StatxMask] $cenumFromThen :: StatxMask -> StatxMask -> [StatxMask] enumFromThen :: StatxMask -> StatxMask -> [StatxMask] $cenumFromTo :: StatxMask -> StatxMask -> [StatxMask] enumFromTo :: StatxMask -> StatxMask -> [StatxMask] $cenumFromThenTo :: StatxMask -> StatxMask -> StatxMask -> [StatxMask] enumFromThenTo :: StatxMask -> StatxMask -> StatxMask -> [StatxMask] Enum,Eq StatxMask StatxMask Eq StatxMask => (StatxMask -> StatxMask -> StatxMask) -> (StatxMask -> StatxMask -> StatxMask) -> (StatxMask -> StatxMask -> StatxMask) -> (StatxMask -> StatxMask) -> (StatxMask -> Int -> StatxMask) -> (StatxMask -> Int -> StatxMask) -> StatxMask -> (Int -> StatxMask) -> (StatxMask -> Int -> StatxMask) -> (StatxMask -> Int -> StatxMask) -> (StatxMask -> Int -> StatxMask) -> (StatxMask -> Int -> Bool) -> (StatxMask -> Maybe Int) -> (StatxMask -> Int) -> (StatxMask -> Bool) -> (StatxMask -> Int -> StatxMask) -> (StatxMask -> Int -> StatxMask) -> (StatxMask -> Int -> StatxMask) -> (StatxMask -> Int -> StatxMask) -> (StatxMask -> Int -> StatxMask) -> (StatxMask -> Int -> StatxMask) -> (StatxMask -> Int) -> Bits StatxMask Int -> StatxMask StatxMask -> Bool StatxMask -> Int StatxMask -> Maybe Int StatxMask -> StatxMask StatxMask -> Int -> Bool StatxMask -> Int -> StatxMask StatxMask -> StatxMask -> StatxMask forall a. Eq a => (a -> a -> a) -> (a -> a -> a) -> (a -> a -> a) -> (a -> a) -> (a -> Int -> a) -> (a -> Int -> a) -> a -> (Int -> a) -> (a -> Int -> a) -> (a -> Int -> a) -> (a -> Int -> a) -> (a -> Int -> Bool) -> (a -> Maybe Int) -> (a -> Int) -> (a -> Bool) -> (a -> Int -> a) -> (a -> Int -> a) -> (a -> Int -> a) -> (a -> Int -> a) -> (a -> Int -> a) -> (a -> Int -> a) -> (a -> Int) -> Bits a $c.&. :: StatxMask -> StatxMask -> StatxMask .&. :: StatxMask -> StatxMask -> StatxMask $c.|. :: StatxMask -> StatxMask -> StatxMask .|. :: StatxMask -> StatxMask -> StatxMask $cxor :: StatxMask -> StatxMask -> StatxMask xor :: StatxMask -> StatxMask -> StatxMask $ccomplement :: StatxMask -> StatxMask complement :: StatxMask -> StatxMask $cshift :: StatxMask -> Int -> StatxMask shift :: StatxMask -> Int -> StatxMask $crotate :: StatxMask -> Int -> StatxMask rotate :: StatxMask -> Int -> StatxMask $czeroBits :: StatxMask zeroBits :: StatxMask $cbit :: Int -> StatxMask bit :: Int -> StatxMask $csetBit :: StatxMask -> Int -> StatxMask setBit :: StatxMask -> Int -> StatxMask $cclearBit :: StatxMask -> Int -> StatxMask clearBit :: StatxMask -> Int -> StatxMask $ccomplementBit :: StatxMask -> Int -> StatxMask complementBit :: StatxMask -> Int -> StatxMask $ctestBit :: StatxMask -> Int -> Bool testBit :: StatxMask -> Int -> Bool $cbitSizeMaybe :: StatxMask -> Maybe Int bitSizeMaybe :: StatxMask -> Maybe Int $cbitSize :: StatxMask -> Int bitSize :: StatxMask -> Int $cisSigned :: StatxMask -> Bool isSigned :: StatxMask -> Bool $cshiftL :: StatxMask -> Int -> StatxMask shiftL :: StatxMask -> Int -> StatxMask $cunsafeShiftL :: StatxMask -> Int -> StatxMask unsafeShiftL :: StatxMask -> Int -> StatxMask $cshiftR :: StatxMask -> Int -> StatxMask shiftR :: StatxMask -> Int -> StatxMask $cunsafeShiftR :: StatxMask -> Int -> StatxMask unsafeShiftR :: StatxMask -> Int -> StatxMask $crotateL :: StatxMask -> Int -> StatxMask rotateL :: StatxMask -> Int -> StatxMask $crotateR :: StatxMask -> Int -> StatxMask rotateR :: StatxMask -> Int -> StatxMask $cpopCount :: StatxMask -> Int popCount :: StatxMask -> Int Bits,Num StatxMask Ord StatxMask (Num StatxMask, Ord StatxMask) => (StatxMask -> Rational) -> Real StatxMask StatxMask -> Rational forall a. (Num a, Ord a) => (a -> Rational) -> Real a $ctoRational :: StatxMask -> Rational toRational :: StatxMask -> Rational Real)-- | ORs the masks.instanceSemigroupStatxMask whereStatxMask a <> :: StatxMask -> StatxMask -> StatxMask <>StatxMask b =StatxMask a StatxMask -> StatxMask -> StatxMask forall a. Bits a => a -> a -> a .|.StatxMask b instanceMonoidStatxMask wheremappend :: StatxMask -> StatxMask -> StatxMask mappend=StatxMask -> StatxMask -> StatxMask forall a. Semigroup a => a -> a -> a (<>)mempty :: StatxMask mempty=StatxMask 0-- | Want @stx_mode & S_IFMT@.patternStatxType ::StatxMask {-# LINE 872 "System/Posix/Files/Common.hsc" #-}patternStatxType=StatxMask(1){-# LINE 873 "System/Posix/Files/Common.hsc" #-}{-# LINE 876 "System/Posix/Files/Common.hsc" #-}-- | Want @stx_mode & ~S_IFMT@.patternStatxMode ::StatxMask {-# LINE 880 "System/Posix/Files/Common.hsc" #-}patternStatxMode=StatxMask(2){-# LINE 881 "System/Posix/Files/Common.hsc" #-}{-# LINE 884 "System/Posix/Files/Common.hsc" #-}-- | Want @stx_nlink@.patternStatxNlink ::StatxMask {-# LINE 888 "System/Posix/Files/Common.hsc" #-}patternStatxNlink=StatxMask(4){-# LINE 889 "System/Posix/Files/Common.hsc" #-}{-# LINE 892 "System/Posix/Files/Common.hsc" #-}-- | Want @stx_uid@.patternStatxUid ::StatxMask {-# LINE 896 "System/Posix/Files/Common.hsc" #-}patternStatxUid=StatxMask(8){-# LINE 897 "System/Posix/Files/Common.hsc" #-}{-# LINE 900 "System/Posix/Files/Common.hsc" #-}-- | Want @stx_gid@.patternStatxGid ::StatxMask {-# LINE 904 "System/Posix/Files/Common.hsc" #-}patternStatxGid=StatxMask(16){-# LINE 905 "System/Posix/Files/Common.hsc" #-}{-# LINE 908 "System/Posix/Files/Common.hsc" #-}-- | Want @stx_atime@.patternStatxAtime ::StatxMask {-# LINE 912 "System/Posix/Files/Common.hsc" #-}patternStatxAtime=StatxMask(32){-# LINE 913 "System/Posix/Files/Common.hsc" #-}{-# LINE 916 "System/Posix/Files/Common.hsc" #-}-- | Want @stx_mtime@.patternStatxMtime ::StatxMask {-# LINE 920 "System/Posix/Files/Common.hsc" #-}patternStatxMtime=StatxMask(64){-# LINE 921 "System/Posix/Files/Common.hsc" #-}{-# LINE 924 "System/Posix/Files/Common.hsc" #-}-- | Want @stx_ctime@.patternStatxCtime ::StatxMask {-# LINE 928 "System/Posix/Files/Common.hsc" #-}patternStatxCtime=StatxMask(128){-# LINE 929 "System/Posix/Files/Common.hsc" #-}{-# LINE 932 "System/Posix/Files/Common.hsc" #-}-- | Want @stx_btime@.patternStatxBtime ::StatxMask {-# LINE 936 "System/Posix/Files/Common.hsc" #-}patternStatxBtime=StatxMask(2048){-# LINE 937 "System/Posix/Files/Common.hsc" #-}{-# LINE 940 "System/Posix/Files/Common.hsc" #-}-- | Want @stx_mnt_id@.patternStatxMntId ::StatxMask {-# LINE 944 "System/Posix/Files/Common.hsc" #-}patternStatxMntId=StatxMask(4096){-# LINE 945 "System/Posix/Files/Common.hsc" #-}{-# LINE 948 "System/Posix/Files/Common.hsc" #-}-- | Want @stx_ino@.patternStatxIno ::StatxMask {-# LINE 952 "System/Posix/Files/Common.hsc" #-}patternStatxIno=StatxMask(256){-# LINE 953 "System/Posix/Files/Common.hsc" #-}{-# LINE 956 "System/Posix/Files/Common.hsc" #-}-- | Want @stx_size@.patternStatxSize ::StatxMask {-# LINE 960 "System/Posix/Files/Common.hsc" #-}patternStatxSize=StatxMask(512){-# LINE 961 "System/Posix/Files/Common.hsc" #-}{-# LINE 964 "System/Posix/Files/Common.hsc" #-}-- | Want @stx_blocks@.patternStatxBlocks ::StatxMask {-# LINE 968 "System/Posix/Files/Common.hsc" #-}patternStatxBlocks=StatxMask(1024){-# LINE 969 "System/Posix/Files/Common.hsc" #-}{-# LINE 972 "System/Posix/Files/Common.hsc" #-}-- | Want all of the above.patternStatxBasicStats ::StatxMask {-# LINE 976 "System/Posix/Files/Common.hsc" #-}patternStatxBasicStats=StatxMask(2047){-# LINE 977 "System/Posix/Files/Common.hsc" #-}{-# LINE 980 "System/Posix/Files/Common.hsc" #-}-- | Want all currently available fields.patternStatxAll ::StatxMask {-# LINE 984 "System/Posix/Files/Common.hsc" #-}patternStatxAll=StatxMask(4095){-# LINE 985 "System/Posix/Files/Common.hsc" #-}{-# LINE 988 "System/Posix/Files/Common.hsc" #-}defaultStatxMask ::StatxMask defaultStatxMask :: StatxMask defaultStatxMask =StatxMask forall a. Monoid a => a memptynewtypeExtendedFileStatus =ExtendedFileStatus (ForeignPtrCStatx )-- ^ The constructor is considered internal and may change.-- | The "preferred" block size for efficient filesystem I/O.-- (Writing to a file in smaller chunks may cause an inefficient read-mod‐ify-rewrite.)fileBlockSizeX ::ExtendedFileStatus ->CBlkSize{-# LINE 999 "System/Posix/Files/Common.hsc" #-}-- | Further status information about the file.fileAttributesX ::ExtendedFileStatus ->CAttributes {-# LINE 1002 "System/Posix/Files/Common.hsc" #-}-- | The number of hard links on a file.linkCountX ::ExtendedFileStatus ->CNlink-- | Te user ID of the owner of the file.fileOwnerX ::ExtendedFileStatus ->UserID-- | The ID of the group owner of the file.fileGroupX ::ExtendedFileStatus ->GroupID-- | The file type and mode. See @inode(7)@ for details.fileModeX ::ExtendedFileStatus ->FileMode-- | The inode number of the file.fileIDX ::ExtendedFileStatus ->FileID-- | The size of the file (if it is a regular file or a symbolic link) in bytes.-- The size of a symbolic link is the length of the pathname it contains,-- without a terminating null byte.fileSizeX ::ExtendedFileStatus ->Word64-- | The number of blocks allocated to the file on the medium, in 512-byte units.-- (This may be smaller than stx_size/512 when the file has holes.)fileBlocksX ::ExtendedFileStatus ->Word64{-# LINE 1020 "System/Posix/Files/Common.hsc" #-}-- | A mask indicating which bits in 'fileAttributesX' are supported by the VFS and the filesystem.fileAttributesMaskX ::ExtendedFileStatus ->CAttributes {-# LINE 1023 "System/Posix/Files/Common.hsc" #-}-- | The file's last access timestamp.accessTimeHiResX ::ExtendedFileStatus ->POSIXTime-- | The file's creation timestamp.creationTimeHiResX ::ExtendedFileStatus ->POSIXTime-- | The file's last status change timestamp.statusChangeTimeHiResX ::ExtendedFileStatus ->POSIXTime-- | The file's last modification timestamp.modificationTimeHiResX ::ExtendedFileStatus ->POSIXTime-- | ID of the device on which this file resides.deviceIDX ::ExtendedFileStatus ->DeviceID-- | Describes the device that this file represents.specialDeviceIDX ::ExtendedFileStatus ->DeviceID-- | The mount ID of the mount containing the file. This is the same number-- reported by name_to_handle_at(2) and corresponds to the number in the-- first field in one of the records in /proc/self/mountinfo.mountIDX ::ExtendedFileStatus ->Word64-- | The file is compressed by the filesystem and may take extra resources to access.-- This is an extended attribute.fileCompressedX ::ExtendedFileStatus ->Bool-- | The file cannot be modified: it cannot be deleted or renamed, no hard links can-- be created to this file and no data can be written to it. See @chattr(1)@.-- This is an extended attribute.fileImmutableX ::ExtendedFileStatus ->Bool-- | The file can only be opened in append mode for writing. Random access writing is not permitted. See @chattr(1)@.-- This is an extended attribute.fileAppendX ::ExtendedFileStatus ->Bool-- | File is not a candidate for backup when a backup program such as @dump(8)@ is run. See @chattr(1)@.-- This is an extended attribute.fileNoDumpX ::ExtendedFileStatus ->Bool-- | A key is required for the file to be encrypted by the filesystem.-- This is an extended attribute.fileEncryptedX ::ExtendedFileStatus ->Bool-- | The file has fs-verity enabled. It cannot be written to, and all reads from it-- will be verified against a cryptographic hash that covers the entire file (e.g., via a Merkle tree).-- This is an extended attribute.-- Since Linux 5.5.fileVerityX ::ExtendedFileStatus ->Bool-- | The file is in the DAX (cpu direct access) state.-- This is an extended attribute.-- Since Linux 5.8.fileDaxX ::ExtendedFileStatus ->Bool-- | Checks if this file is a block device.isBlockDeviceX ::ExtendedFileStatus ->Bool-- | Checks if this file is a character device.isCharacterDeviceX ::ExtendedFileStatus ->Bool-- | Checks if this file is a named pipe device.isNamedPipeX ::ExtendedFileStatus ->Bool-- | Checks if this file is a regular file device.isRegularFileX ::ExtendedFileStatus ->Bool-- | Checks if this file is a directory device.isDirectoryX ::ExtendedFileStatus ->Bool-- | Checks if this file is a symbolic link device.isSymbolicLinkX ::ExtendedFileStatus ->Bool-- | Checks if this file is a socket device.isSocketX ::ExtendedFileStatus ->BoolisBlockDeviceX :: ExtendedFileStatus -> Bool isBlockDeviceX ExtendedFileStatus statx =(ExtendedFileStatus -> FileMode fileModeX ExtendedFileStatus statx FileMode -> FileMode -> FileMode `intersectFileModes` FileMode fileTypeModes )FileMode -> FileMode -> Bool forall a. Eq a => a -> a -> Bool ==FileMode blockSpecialMode isCharacterDeviceX :: ExtendedFileStatus -> Bool isCharacterDeviceX ExtendedFileStatus statx =(ExtendedFileStatus -> FileMode fileModeX ExtendedFileStatus statx FileMode -> FileMode -> FileMode `intersectFileModes` FileMode fileTypeModes )FileMode -> FileMode -> Bool forall a. Eq a => a -> a -> Bool ==FileMode characterSpecialMode isNamedPipeX :: ExtendedFileStatus -> Bool isNamedPipeX ExtendedFileStatus statx =(ExtendedFileStatus -> FileMode fileModeX ExtendedFileStatus statx FileMode -> FileMode -> FileMode `intersectFileModes` FileMode fileTypeModes )FileMode -> FileMode -> Bool forall a. Eq a => a -> a -> Bool ==FileMode namedPipeMode isRegularFileX :: ExtendedFileStatus -> Bool isRegularFileX ExtendedFileStatus statx =(ExtendedFileStatus -> FileMode fileModeX ExtendedFileStatus statx FileMode -> FileMode -> FileMode `intersectFileModes` FileMode fileTypeModes )FileMode -> FileMode -> Bool forall a. Eq a => a -> a -> Bool ==FileMode regularFileMode isDirectoryX :: ExtendedFileStatus -> Bool isDirectoryX ExtendedFileStatus statx =(ExtendedFileStatus -> FileMode fileModeX ExtendedFileStatus statx FileMode -> FileMode -> FileMode `intersectFileModes` FileMode fileTypeModes )FileMode -> FileMode -> Bool forall a. Eq a => a -> a -> Bool ==FileMode directoryMode isSymbolicLinkX :: ExtendedFileStatus -> Bool isSymbolicLinkX ExtendedFileStatus statx =(ExtendedFileStatus -> FileMode fileModeX ExtendedFileStatus statx FileMode -> FileMode -> FileMode `intersectFileModes` FileMode fileTypeModes )FileMode -> FileMode -> Bool forall a. Eq a => a -> a -> Bool ==FileMode symbolicLinkMode isSocketX :: ExtendedFileStatus -> Bool isSocketX ExtendedFileStatus statx =(ExtendedFileStatus -> FileMode fileModeX ExtendedFileStatus statx FileMode -> FileMode -> FileMode `intersectFileModes` FileMode fileTypeModes )FileMode -> FileMode -> Bool forall a. Eq a => a -> a -> Bool ==FileMode socketMode {-# LINE 1096 "System/Posix/Files/Common.hsc" #-} testFlag::ExtendedFileStatus->CAttributes->BooltestFlag :: ExtendedFileStatus -> CAttributes -> Bool testFlag ExtendedFileStatus ex CAttributes flag =letattributes :: CAttributes attributes =ExtendedFileStatus -> CAttributes fileAttributesX ExtendedFileStatus ex attributes_mask :: CAttributes attributes_mask =ExtendedFileStatus -> CAttributes fileAttributesMaskX ExtendedFileStatus ex in(CAttributes attributes CAttributes -> CAttributes -> CAttributes forall a. Bits a => a -> a -> a .&.CAttributes attributes_mask CAttributes -> CAttributes -> CAttributes forall a. Bits a => a -> a -> a .&.CAttributes flag )CAttributes -> CAttributes -> Bool forall a. Eq a => a -> a -> Bool /=CAttributes 0{-# LINE 1103 "System/Posix/Files/Common.hsc" #-}fileCompressedXex=testFlagex(4){-# LINE 1104 "System/Posix/Files/Common.hsc" #-}{-# LINE 1108 "System/Posix/Files/Common.hsc" #-}{-# LINE 1109 "System/Posix/Files/Common.hsc" #-}fileImmutableXex=testFlagex(16){-# LINE 1110 "System/Posix/Files/Common.hsc" #-}{-# LINE 1114 "System/Posix/Files/Common.hsc" #-}{-# LINE 1115 "System/Posix/Files/Common.hsc" #-}fileAppendXex=testFlagex(32){-# LINE 1116 "System/Posix/Files/Common.hsc" #-}{-# LINE 1120 "System/Posix/Files/Common.hsc" #-}{-# LINE 1121 "System/Posix/Files/Common.hsc" #-}fileNoDumpXex=testFlagex(64){-# LINE 1122 "System/Posix/Files/Common.hsc" #-}{-# LINE 1126 "System/Posix/Files/Common.hsc" #-}{-# LINE 1127 "System/Posix/Files/Common.hsc" #-}fileEncryptedXex=testFlagex(2048){-# LINE 1128 "System/Posix/Files/Common.hsc" #-}{-# LINE 1132 "System/Posix/Files/Common.hsc" #-}{-# LINE 1133 "System/Posix/Files/Common.hsc" #-}fileVerityXex=testFlagex(1048576){-# LINE 1134 "System/Posix/Files/Common.hsc" #-}{-# LINE 1138 "System/Posix/Files/Common.hsc" #-}fileDaxX :: ExtendedFileStatus -> Bool {-# LINE 1139 "System/Posix/Files/Common.hsc" #-} fileDaxXex=testFlagex(2097152){-# LINE 1140 "System/Posix/Files/Common.hsc" #-}{-# LINE 1144 "System/Posix/Files/Common.hsc" #-}{-# LINE 1146 "System/Posix/Files/Common.hsc" #-}deviceIDX(ExtendedFileStatusstatx)=unsafePerformIO$domajor<-withForeignPtrstatx$((\hsc_ptr->peekByteOffhsc_ptr136))::IOCUInt{-# LINE 1148 "System/Posix/Files/Common.hsc" #-}minor<-withForeignPtrstatx$((\hsc_ptr->peekByteOffhsc_ptr140))::IOCUInt{-# LINE 1149 "System/Posix/Files/Common.hsc" #-}c_makedevmajorminor{-# LINE 1154 "System/Posix/Files/Common.hsc" #-}{-# LINE 1155 "System/Posix/Files/Common.hsc" #-}specialDeviceIDX(ExtendedFileStatusstatx)=unsafePerformIO$domajor<-withForeignPtrstatx$((\hsc_ptr->peekByteOffhsc_ptr128))::IOCUInt{-# LINE 1157 "System/Posix/Files/Common.hsc" #-}minor<-withForeignPtrstatx$((\hsc_ptr->peekByteOffhsc_ptr132))::IOCUInt{-# LINE 1158 "System/Posix/Files/Common.hsc" #-}c_makedevmajorminor{-# LINE 1163 "System/Posix/Files/Common.hsc" #-}mountIDX :: ExtendedFileStatus -> Word64 {-# LINE 1164 "System/Posix/Files/Common.hsc" #-} mountIDX(ExtendedFileStatusstatx)=unsafePerformIO$withForeignPtrstatx$((\hsc_ptr->peekByteOffhsc_ptr144)){-# LINE 1166 "System/Posix/Files/Common.hsc" #-}{-# LINE 1170 "System/Posix/Files/Common.hsc" #-}fileBlockSizeX :: ExtendedFileStatus -> CBlkSize fileBlockSizeX (ExtendedFileStatus ForeignPtr CStatx statx )=IO CBlkSize -> CBlkSize forall a. IO a -> a unsafePerformIO(IO CBlkSize -> CBlkSize) -> IO CBlkSize -> CBlkSize forall a b. (a -> b) -> a -> b $doWord32 r <-ForeignPtr CStatx -> (Ptr CStatx -> IO Word32) -> IO Word32 forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b withForeignPtrForeignPtr CStatx statx ((Ptr CStatx -> IO Word32) -> IO Word32) -> (Ptr CStatx -> IO Word32) -> IO Word32 forall a b. (a -> b) -> a -> b $((\Ptr CStatx hsc_ptr ->Ptr CStatx -> Int -> IO Word32 forall b. Ptr b -> Int -> IO Word32 forall a b. Storable a => Ptr b -> Int -> IO a peekByteOffPtr CStatx hsc_ptr Int 4))::IOWord32{-# LINE 1172 "System/Posix/Files/Common.hsc" #-}return$CBlkSize(fromIntegralr)fileAttributesX :: ExtendedFileStatus -> CAttributes fileAttributesX (ExtendedFileStatus ForeignPtr CStatx statx )=IO CAttributes -> CAttributes forall a. IO a -> a unsafePerformIO(IO CAttributes -> CAttributes) -> IO CAttributes -> CAttributes forall a b. (a -> b) -> a -> b $ForeignPtr CStatx -> (Ptr CStatx -> IO CAttributes) -> IO CAttributes forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b withForeignPtrForeignPtr CStatx statx ((Ptr CStatx -> IO CAttributes) -> IO CAttributes) -> (Ptr CStatx -> IO CAttributes) -> IO CAttributes forall a b. (a -> b) -> a -> b $((\Ptr CStatx hsc_ptr ->Ptr CStatx -> Int -> IO CAttributes forall b. Ptr b -> Int -> IO CAttributes forall a b. Storable a => Ptr b -> Int -> IO a peekByteOffPtr CStatx hsc_ptr Int 8)){-# LINE 1175 "System/Posix/Files/Common.hsc" #-}{-# LINE 1176 "System/Posix/Files/Common.hsc" #-}linkCountX(ExtendedFileStatusstatx)=unsafePerformIO$dolinks<-withForeignPtrstatx$((\hsc_ptr->peekByteOffhsc_ptr16))::IOWord32{-# LINE 1178 "System/Posix/Files/Common.hsc" #-}return$CNlink(fromIntegrallinks){-# LINE 1183 "System/Posix/Files/Common.hsc" #-}{-# LINE 1184 "System/Posix/Files/Common.hsc" #-}fileOwnerX(ExtendedFileStatusstatx)=unsafePerformIO$withForeignPtrstatx$((\hsc_ptr->peekByteOffhsc_ptr20)){-# LINE 1186 "System/Posix/Files/Common.hsc" #-}{-# LINE 1190 "System/Posix/Files/Common.hsc" #-}{-# LINE 1191 "System/Posix/Files/Common.hsc" #-}fileGroupX(ExtendedFileStatusstatx)=unsafePerformIO$withForeignPtrstatx$((\hsc_ptr->peekByteOffhsc_ptr24)){-# LINE 1193 "System/Posix/Files/Common.hsc" #-}{-# LINE 1197 "System/Posix/Files/Common.hsc" #-}{-# LINE 1198 "System/Posix/Files/Common.hsc" #-}fileModeX(ExtendedFileStatusstatx)=unsafePerformIO$dor<-withForeignPtrstatx$((\hsc_ptr->peekByteOffhsc_ptr28))::IOWord16{-# LINE 1200 "System/Posix/Files/Common.hsc" #-}return$CMode$fromIntegralr{-# LINE 1205 "System/Posix/Files/Common.hsc" #-}{-# LINE 1206 "System/Posix/Files/Common.hsc" #-}fileIDX(ExtendedFileStatusstatx)=unsafePerformIO$withForeignPtrstatx$((\hsc_ptr->peekByteOffhsc_ptr32)){-# LINE 1208 "System/Posix/Files/Common.hsc" #-}{-# LINE 1212 "System/Posix/Files/Common.hsc" #-}{-# LINE 1213 "System/Posix/Files/Common.hsc" #-}fileSizeX(ExtendedFileStatusstatx)=unsafePerformIO$withForeignPtrstatx$((\hsc_ptr->peekByteOffhsc_ptr40))::Word64{-# LINE 1215 "System/Posix/Files/Common.hsc" #-}{-# LINE 1219 "System/Posix/Files/Common.hsc" #-}{-# LINE 1220 "System/Posix/Files/Common.hsc" #-}fileBlocksX(ExtendedFileStatusstatx)=unsafePerformIO$withForeignPtrstatx$((\hsc_ptr->peekByteOffhsc_ptr48))::Word64{-# LINE 1222 "System/Posix/Files/Common.hsc" #-}{-# LINE 1226 "System/Posix/Files/Common.hsc" #-}fileAttributesMaskX :: ExtendedFileStatus -> CAttributes fileAttributesMaskX (ExtendedFileStatus ForeignPtr CStatx statx )=IO CAttributes -> CAttributes forall a. IO a -> a unsafePerformIO(IO CAttributes -> CAttributes) -> IO CAttributes -> CAttributes forall a b. (a -> b) -> a -> b $ForeignPtr CStatx -> (Ptr CStatx -> IO CAttributes) -> IO CAttributes forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b withForeignPtrForeignPtr CStatx statx ((Ptr CStatx -> IO CAttributes) -> IO CAttributes) -> (Ptr CStatx -> IO CAttributes) -> IO CAttributes forall a b. (a -> b) -> a -> b $((\Ptr CStatx hsc_ptr ->Ptr CStatx -> Int -> IO CAttributes forall b. Ptr b -> Int -> IO CAttributes forall a b. Storable a => Ptr b -> Int -> IO a peekByteOffPtr CStatx hsc_ptr Int 56)){-# LINE 1228 "System/Posix/Files/Common.hsc" #-}{-# LINE 1229 "System/Posix/Files/Common.hsc" #-}accessTimeHiResX(ExtendedFileStatusstatx)=unsafePerformIO$withForeignPtrstatx$\statx_ptr->dosec<-((\hsc_ptr->peekByteOffhsc_ptr64))statx_ptr::IOEpochTime{-# LINE 1232 "System/Posix/Files/Common.hsc" #-}nsec<-((\hsc_ptr->peekByteOffhsc_ptr72))statx_ptr::IO(Int32){-# LINE 1233 "System/Posix/Files/Common.hsc" #-}return$timeHiResToNominalDiffTimesecnsec{-# LINE 1238 "System/Posix/Files/Common.hsc" #-}{-# LINE 1239 "System/Posix/Files/Common.hsc" #-}creationTimeHiResX(ExtendedFileStatusstatx)=unsafePerformIO$withForeignPtrstatx$\statx_ptr->dosec<-((\hsc_ptr->peekByteOffhsc_ptr80))statx_ptr::IOEpochTime{-# LINE 1242 "System/Posix/Files/Common.hsc" #-}nsec<-((\hsc_ptr->peekByteOffhsc_ptr88))statx_ptr::IO(Int32){-# LINE 1243 "System/Posix/Files/Common.hsc" #-}return$timeHiResToNominalDiffTimesecnsec{-# LINE 1248 "System/Posix/Files/Common.hsc" #-}{-# LINE 1249 "System/Posix/Files/Common.hsc" #-}statusChangeTimeHiResX(ExtendedFileStatusstatx)=unsafePerformIO$withForeignPtrstatx$\statx_ptr->dosec<-((\hsc_ptr->peekByteOffhsc_ptr96))statx_ptr::IOEpochTime{-# LINE 1252 "System/Posix/Files/Common.hsc" #-}nsec<-((\hsc_ptr->peekByteOffhsc_ptr104))statx_ptr::IO(Int32){-# LINE 1253 "System/Posix/Files/Common.hsc" #-}return$timeHiResToNominalDiffTimesecnsec{-# LINE 1258 "System/Posix/Files/Common.hsc" #-}{-# LINE 1259 "System/Posix/Files/Common.hsc" #-}modificationTimeHiResX(ExtendedFileStatusstatx)=unsafePerformIO$withForeignPtrstatx$\statx_ptr->dosec<-((\hsc_ptr->peekByteOffhsc_ptr112))statx_ptr::IOEpochTime{-# LINE 1262 "System/Posix/Files/Common.hsc" #-}nsec<-((\hsc_ptr->peekByteOffhsc_ptr120))statx_ptr::IO(Int32){-# LINE 1263 "System/Posix/Files/Common.hsc" #-}return$timeHiResToNominalDiffTimesecnsec{-# LINE 1268 "System/Posix/Files/Common.hsc" #-}timeHiResToNominalDiffTime ::EpochTime->Int32->POSIXTimetimeHiResToNominalDiffTime :: EpochTime -> Int32 -> POSIXTime timeHiResToNominalDiffTime (CTimeInt64 sec )Int32 nsec =Pico -> POSIXTime secondsToNominalDiffTime(Pico -> POSIXTime) -> Pico -> POSIXTime forall a b. (a -> b) -> a -> b $Integer -> Pico forall k (a :: k). Integer -> Fixed a MkFixed(Integer -> Pico) -> Integer -> Pico forall a b. (a -> b) -> a -> b $Int64 -> Integer forall a. Integral a => a -> Integer toIntegerInt64 sec Integer -> Integer -> Integer forall a. Num a => a -> a -> a *Integer 1e12Integer -> Integer -> Integer forall a. Num a => a -> a -> a +Int32 -> Integer forall a. Integral a => a -> Integer toIntegerInt32 nsec Integer -> Integer -> Integer forall a. Num a => a -> a -> a *Integer 1e3{-# LINE 1318 "System/Posix/Files/Common.hsc" #-}data{-# CTYPE"struct statx"#-}CStatx {-# LINE 1322 "System/Posix/Files/Common.hsc" #-}foreignimportcapiunsafe"sys/stat.h statx"c_statx::CInt->CFilePath->CInt->CInt->PtrCStatx->IOCInt{-# LINE 1326 "System/Posix/Files/Common.hsc" #-}foreignimportcapiunsafe"sys/sysmacros.h makedev"c_makedev::CUInt->CUInt->IOCDev{-# LINE 1329 "System/Posix/Files/Common.hsc" #-}{-# LINE 1330 "System/Posix/Files/Common.hsc" #-}getExtendedFileStatus_ ::MaybeFd-- ^ Optional directory file descriptor->CString-- ^ Pathname to open->StatxFlags ->StatxMask ->IOExtendedFileStatus {-# LINE 1338 "System/Posix/Files/Common.hsc" #-}getExtendedFileStatus_fdMaystr(StatxFlagsflags)(StatxMaskmasks)=dofp<-mallocForeignPtrBytes(256){-# LINE 1340 "System/Posix/Files/Common.hsc" #-}withForeignPtrfp$\p->throwErrnoIfMinus1_"getExtendedFileStatus_"(c_statxc_fdstrflagsmasksp)return(ExtendedFileStatusfp)wherec_fd=maybe(-100)(\(Fdfd)->fd)fdMay{-# LINE 1345 "System/Posix/Files/Common.hsc" #-}{-# LINE 1349 "System/Posix/Files/Common.hsc" #-}-- | Whether 'statx' is available on this platform and 'getExtendedFileStatus' and-- related functions will work.haveStatx ::Bool{-# LINE 1354 "System/Posix/Files/Common.hsc" #-}haveStatx=True{-# LINE 1358 "System/Posix/Files/Common.hsc" #-}