| Safe Haskell | None |
|---|---|
| Language | GHC2021 |
Effects.System.PosixCompat.Files
Description
Provides the MonadPosixCompatFiles typeclass.
Since: 0.1
Synopsis
- class Monad m => MonadPosixCompatFiles (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, MonadPosixCompatFiles m) => String -> PathType -> FilePath -> m ()
- isPathType :: (HasCallStack, MonadPosixCompatFiles m) => PathType -> FilePath -> m Bool
- getPathType :: (HasCallStack, MonadPosixCompatFiles m) => FilePath -> m PathType
Effect
class Monad m => MonadPosixCompatFiles (m :: Type -> Type) where Source #
Class for unix-compat System.PosixCompat.Files 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
| NFData PathType Source # | Since: fs-utils-0.1 | ||||
Defined in FileSystem.PathType | |||||
| Bounded PathType Source # | Since: fs-utils-0.1 | ||||
| Enum PathType Source # | Since: fs-utils-0.1 | ||||
Defined in FileSystem.PathType | |||||
| Generic PathType Source # | |||||
Defined in FileSystem.PathType Associated Types
| |||||
| Show PathType Source # | Since: fs-utils-0.1 | ||||
| Eq PathType Source # | Since: fs-utils-0.1 | ||||
| Ord PathType Source # | Since: fs-utils-0.1 | ||||
Defined in FileSystem.PathType | |||||
| type Rep PathType Source # | Since: fs-utils-0.1 | ||||
Defined in FileSystem.PathType type Rep PathType = D1 ('MetaData "PathType" "FileSystem.PathType" "fs-utils-0.1-fbba4caea8c7c33ae6e68720026fbc0eb28dfe774a233f29a0428bd722806d8d" '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, MonadPosixCompatFiles 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, MonadPosixCompatFiles 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, MonadPosixCompatFiles 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