Safe Haskell | None |
---|---|
Language | GHC2021 |
Effects.System.Posix
Description
Provides the MonadPosix
typeclass.
Since: 0.1
Synopsis
- class Monad m => MonadPosix (m :: Type -> Type) where
- setFileMode :: PosixPath -> FileMode -> m ()
- setFdMode :: Fd -> FileMode -> m ()
- setFileCreationMask :: FileMode -> m FileMode
- fileAccess :: PosixPath -> Bool -> Bool -> Bool -> m Bool
- fileExist :: PosixPath -> m Bool
- getFileStatus :: PosixPath -> m FileStatus
- getFdStatus :: Fd -> m FileStatus
- getSymbolicLinkStatus :: PosixPath -> m FileStatus
- createNamedPipe :: PosixPath -> FileMode -> m ()
- createDevice :: PosixPath -> FileMode -> DeviceID -> m ()
- createLink :: PosixPath -> PosixPath -> m ()
- removeLink :: PosixPath -> m ()
- createSymbolicLink :: PosixPath -> PosixPath -> m ()
- readSymbolicLink :: PosixPath -> m PosixPath
- rename :: PosixPath -> PosixPath -> m ()
- setOwnerAndGroup :: PosixPath -> UserID -> GroupID -> m ()
- setFdOwnerAndGroup :: Fd -> UserID -> GroupID -> m ()
- setSymbolicLinkOwnerAndGroup :: PosixPath -> UserID -> GroupID -> m ()
- setFileTimes :: PosixPath -> EpochTime -> EpochTime -> m ()
- touchFile :: PosixPath -> m ()
- setFileSize :: PosixPath -> FileOffset -> m ()
- setFdSize :: Fd -> FileOffset -> m ()
- getPathVar :: PosixPath -> PathVar -> m Limit
- getFdPathVar :: Fd -> PathVar -> m Limit
- data PathType
- displayPathType :: IsString a => PathType -> a
- throwIfWrongPathType :: (HasCallStack, MonadCatch m, MonadPosix m) => String -> PathType -> PosixPath -> m ()
- isPathType :: (HasCallStack, MonadPosix m) => PathType -> PosixPath -> m Bool
- getPathType :: (HasCallStack, MonadPosix m) => PosixPath -> m PathType
Effect
class Monad m => MonadPosix (m :: Type -> Type) where Source #
Class for unix effects.
Since: 0.1
Methods
setFileMode :: PosixPath -> FileMode -> m () Source #
Since: 0.1
setFdMode :: Fd -> FileMode -> m () Source #
Since: 0.1
setFileCreationMask :: FileMode -> m FileMode Source #
Since: 0.1
fileAccess :: PosixPath -> Bool -> Bool -> Bool -> m Bool Source #
Since: 0.1
fileExist :: PosixPath -> m Bool Source #
Since: 0.1
getFileStatus :: PosixPath -> m FileStatus Source #
Since: 0.1
getFdStatus :: Fd -> m FileStatus Source #
Since: 0.1
getSymbolicLinkStatus :: PosixPath -> m FileStatus Source #
Since: 0.1
createNamedPipe :: PosixPath -> FileMode -> m () Source #
Since: 0.1
createDevice :: PosixPath -> FileMode -> DeviceID -> m () Source #
Since: 0.1
createLink :: PosixPath -> PosixPath -> m () Source #
Since: 0.1
removeLink :: PosixPath -> m () Source #
Since: 0.1
createSymbolicLink :: PosixPath -> PosixPath -> m () Source #
Since: 0.1
readSymbolicLink :: PosixPath -> m PosixPath Source #
Since: 0.1
rename :: PosixPath -> PosixPath -> m () Source #
Since: 0.1
setOwnerAndGroup :: PosixPath -> UserID -> GroupID -> m () Source #
Since: 0.1
setFdOwnerAndGroup :: Fd -> UserID -> GroupID -> m () Source #
Since: 0.1
setSymbolicLinkOwnerAndGroup :: PosixPath -> UserID -> GroupID -> m () Source #
Since: 0.1
setFileTimes :: PosixPath -> EpochTime -> EpochTime -> m () Source #
Since: 0.1
touchFile :: PosixPath -> m () Source #
Since: 0.1
setFileSize :: PosixPath -> FileOffset -> m () Source #
Since: 0.1
setFdSize :: Fd -> FileOffset -> m () Source #
Since: 0.1
getPathVar :: PosixPath -> 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, MonadPosix m) => String -> PathType -> PosixPath -> m () Source #
Throws IOException
if the path does not exist or the expected path type
does not match actual.
Since: 0.1
isPathType :: (HasCallStack, MonadPosix m) => PathType -> PosixPath -> 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, MonadPosix m) => PosixPath -> 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