Safe Haskell | None |
---|---|
Language | GHC2021 |
Effects.System.PosixCompat
Description
Provides the MonadPosixCompat
typeclass.
Since: 0.1
Synopsis
- class Monad m => MonadPosixCompat (m :: Type -> Type) where
- setFileMode :: FilePath -> FileMode -> m ()
- setFdMode :: Fd -> FileMode -> m ()
- setFileCreationMask :: FileMode -> m FileMode
- fileAccess :: FilePath -> Bool -> Bool -> Bool -> m Bool
- fileExist :: FilePath -> m Bool
- getFileStatus :: FilePath -> m FileStatus
- getFdStatus :: Fd -> m FileStatus
- getSymbolicLinkStatus :: FilePath -> m FileStatus
- createNamedPipe :: FilePath -> FileMode -> m ()
- createDevice :: FilePath -> FileMode -> DeviceID -> m ()
- createLink :: FilePath -> FilePath -> m ()
- removeLink :: FilePath -> m ()
- createSymbolicLink :: FilePath -> FilePath -> m ()
- readSymbolicLink :: FilePath -> m FilePath
- rename :: FilePath -> FilePath -> m ()
- setOwnerAndGroup :: FilePath -> UserID -> GroupID -> m ()
- setFdOwnerAndGroup :: Fd -> UserID -> GroupID -> m ()
- setSymbolicLinkOwnerAndGroup :: FilePath -> UserID -> GroupID -> m ()
- setFileTimes :: FilePath -> EpochTime -> EpochTime -> m ()
- touchFile :: FilePath -> m ()
- setFileSize :: FilePath -> FileOffset -> m ()
- setFdSize :: Fd -> FileOffset -> m ()
- getPathVar :: FilePath -> PathVar -> m Limit
- getFdPathVar :: Fd -> PathVar -> m Limit
- data PathType
- displayPathType :: IsString a => PathType -> a
- throwIfWrongPathType :: (HasCallStack, MonadCatch m, MonadPosixCompat m) => String -> PathType -> FilePath -> m ()
- isPathType :: (HasCallStack, MonadPosixCompat m) => PathType -> FilePath -> m Bool
- getPathType :: (HasCallStack, MonadPosixCompat m) => FilePath -> m PathType
Effect
class Monad m => MonadPosixCompat (m :: Type -> Type) where Source #
Class for unix-compat effects.
Since: 0.1
Methods
setFileMode :: FilePath -> FileMode -> m () Source #
Since: 0.1
setFdMode :: Fd -> FileMode -> m () Source #
Since: 0.1
setFileCreationMask :: FileMode -> m FileMode Source #
Since: 0.1
fileAccess :: FilePath -> Bool -> Bool -> Bool -> m Bool Source #
Since: 0.1
fileExist :: FilePath -> m Bool Source #
Since: 0.1
getFileStatus :: FilePath -> m FileStatus Source #
Since: 0.1
getFdStatus :: Fd -> m FileStatus Source #
Since: 0.1
getSymbolicLinkStatus :: FilePath -> m FileStatus Source #
Since: 0.1
createNamedPipe :: FilePath -> FileMode -> m () Source #
Since: 0.1
createDevice :: FilePath -> FileMode -> DeviceID -> m () Source #
Since: 0.1
createLink :: FilePath -> FilePath -> m () Source #
Since: 0.1
removeLink :: FilePath -> m () Source #
Since: 0.1
createSymbolicLink :: FilePath -> FilePath -> m () Source #
Since: 0.1
readSymbolicLink :: FilePath -> m FilePath Source #
Since: 0.1
rename :: FilePath -> FilePath -> m () Source #
Since: 0.1
setOwnerAndGroup :: FilePath -> UserID -> GroupID -> m () Source #
Since: 0.1
setFdOwnerAndGroup :: Fd -> UserID -> GroupID -> m () Source #
Since: 0.1
setSymbolicLinkOwnerAndGroup :: FilePath -> UserID -> GroupID -> m () Source #
Since: 0.1
setFileTimes :: FilePath -> EpochTime -> EpochTime -> m () Source #
Since: 0.1
touchFile :: FilePath -> m () Source #
Since: 0.1
setFileSize :: FilePath -> FileOffset -> m () Source #
Since: 0.1
setFdSize :: Fd -> FileOffset -> m () Source #
Since: 0.1
getPathVar :: FilePath -> PathVar -> m Limit Source #
Since: 0.1
getFdPathVar :: Fd -> PathVar -> m Limit Source #
Since: 0.1
Instances
PathType
Path type.
Since: fs-utils-0.1
Constructors
PathTypeFile | Since: fs-utils-0.1 |
PathTypeDirectory | Since: fs-utils-0.1 |
PathTypeSymbolicLink | Since: fs-utils-0.1 |
PathTypeOther | Since: fs-utils-0.1 |
Instances
Bounded PathType | Since: fs-utils-0.1 | ||||
Enum PathType | Since: fs-utils-0.1 | ||||
Defined in FileSystem.PathType | |||||
Generic PathType | |||||
Defined in FileSystem.PathType Associated Types
| |||||
Show PathType | Since: fs-utils-0.1 | ||||
NFData PathType | Since: fs-utils-0.1 | ||||
Defined in FileSystem.PathType | |||||
Eq PathType | Since: fs-utils-0.1 | ||||
Ord PathType | Since: fs-utils-0.1 | ||||
Defined in FileSystem.PathType | |||||
type Rep PathType | Since: fs-utils-0.1 | ||||
Defined in FileSystem.PathType type Rep PathType = D1 ('MetaData "PathType" "FileSystem.PathType" "fs-utils-0.1-e372dd9cd77baa6a563dd7032c473a3c70c538a3226981dab13c2716d821a2ce" 'False) ((C1 ('MetaCons "PathTypeFile" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "PathTypeDirectory" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "PathTypeSymbolicLink" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "PathTypeOther" 'PrefixI 'False) (U1 :: Type -> Type))) |
Functions
displayPathType :: IsString a => PathType -> a Source #
String representation of PathType
.
Since: fs-utils-0.1
throwIfWrongPathType :: (HasCallStack, MonadCatch m, MonadPosixCompat m) => String -> PathType -> FilePath -> m () Source #
Throws IOException
if the path does not exist or the expected path type
does not match actual.
Since: 0.1
isPathType :: (HasCallStack, MonadPosixCompat m) => PathType -> FilePath -> m Bool Source #
Checks that the path type matches the expectation. Throws
IOException
if the path does not exist or the type cannot be detected.
Since: 0.1
getPathType :: (HasCallStack, MonadPosixCompat m) => FilePath -> m PathType Source #
Returns the type for a given path without following symlinks.
Throws IOException
if the path does not exist or the type cannot be
detected.
Since: 0.1