unix-compat-effectful-0.1: Unix-compat effects
Safe HaskellNone
LanguageGHC2021

Effectful.PosixCompat.Files.Static

Description

Provides a static effect for System.PosixCompat.Files.

Since: 0.1

Synopsis

Effect

data PosixCompatFiles (a :: Type -> Type) b Source #

Provides a static effect for System.PosixCompat.Files.

Since: 0.1

setFileMode :: forall (es :: [Effect]). (HasCallStack, PosixCompatFiles :> es) => FilePath -> FileMode -> Eff es () Source #

Lifted setFileMode.

Since: 0.1

setFdMode :: forall (es :: [Effect]). (HasCallStack, PosixCompatFiles :> es) => Fd -> FileMode -> Eff es () Source #

Lifted setFdMode.

Since: 0.1

fileAccess :: forall (es :: [Effect]). (HasCallStack, PosixCompatFiles :> es) => FilePath -> Bool -> Bool -> Bool -> Eff es Bool Source #

Lifted fileAccess.

Since: 0.1

fileExist :: forall (es :: [Effect]). (HasCallStack, PosixCompatFiles :> es) => FilePath -> Eff es Bool Source #

Lifted fileExist.

Since: 0.1

getFileStatus :: forall (es :: [Effect]). (HasCallStack, PosixCompatFiles :> es) => FilePath -> Eff es FileStatus Source #

Lifted getFileStatus.

Since: 0.1

getFdStatus :: forall (es :: [Effect]). (HasCallStack, PosixCompatFiles :> es) => Fd -> Eff es FileStatus Source #

Lifted getFdStatus.

Since: 0.1

createNamedPipe :: forall (es :: [Effect]). (HasCallStack, PosixCompatFiles :> es) => FilePath -> FileMode -> Eff es () Source #

Lifted createNamedPipe.

Since: 0.1

createDevice :: forall (es :: [Effect]). (HasCallStack, PosixCompatFiles :> es) => FilePath -> FileMode -> DeviceID -> Eff es () Source #

Lifted createDevice.

Since: 0.1

createLink :: forall (es :: [Effect]). (HasCallStack, PosixCompatFiles :> es) => FilePath -> FilePath -> Eff es () Source #

Lifted createLink.

Since: 0.1

removeLink :: forall (es :: [Effect]). (HasCallStack, PosixCompatFiles :> es) => FilePath -> Eff es () Source #

Lifted removeLink.

Since: 0.1

createSymbolicLink :: forall (es :: [Effect]). (HasCallStack, PosixCompatFiles :> es) => FilePath -> FilePath -> Eff es () Source #

Lifted createSymbolicLink.

Since: 0.1

readSymbolicLink :: forall (es :: [Effect]). (HasCallStack, PosixCompatFiles :> es) => FilePath -> Eff es FilePath Source #

Lifted readSymbolicLink.

Since: 0.1

rename :: forall (es :: [Effect]). (HasCallStack, PosixCompatFiles :> es) => FilePath -> FilePath -> Eff es () Source #

Lifted rename.

Since: 0.1

setOwnerAndGroup :: forall (es :: [Effect]). (HasCallStack, PosixCompatFiles :> es) => FilePath -> UserID -> GroupID -> Eff es () Source #

Lifted setOwnerAndGroup.

Since: 0.1

setFdOwnerAndGroup :: forall (es :: [Effect]). (HasCallStack, PosixCompatFiles :> es) => Fd -> UserID -> GroupID -> Eff es () Source #

Lifted setFdOwnerAndGroup.

Since: 0.1

setFileTimes :: forall (es :: [Effect]). (HasCallStack, PosixCompatFiles :> es) => FilePath -> EpochTime -> EpochTime -> Eff es () Source #

Lifted setFileTimes.

Since: 0.1

touchFile :: forall (es :: [Effect]). (HasCallStack, PosixCompatFiles :> es) => FilePath -> Eff es () Source #

Lifted touchFile.

Since: 0.1

setFileSize :: forall (es :: [Effect]). (HasCallStack, PosixCompatFiles :> es) => FilePath -> FileOffset -> Eff es () Source #

Lifted setFileSize.

Since: 0.1

setFdSize :: forall (es :: [Effect]). (HasCallStack, PosixCompatFiles :> es) => Fd -> FileOffset -> Eff es () Source #

Lifted setFdSize.

Since: 0.1

getPathVar :: forall (es :: [Effect]). (HasCallStack, PosixCompatFiles :> es) => FilePath -> PathVar -> Eff es Limit Source #

Lifted getPathVar.

Since: 0.1

getFdPathVar :: forall (es :: [Effect]). (HasCallStack, PosixCompatFiles :> es) => Fd -> PathVar -> Eff es Limit Source #

Lifted getFdPathVar.

Since: 0.1

Handler

runPosixFilesCompat :: forall (es :: [Effect]) a. (HasCallStack, IOE :> es) => Eff (PosixCompatFiles ': es) a -> Eff es a Source #

Runs a Posix effect.

Since: 0.1

PathType

data PathType Source #

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

Instances details
NFData PathType

Since: fs-utils-0.1

Instance details

Defined in FileSystem.PathType

Methods

rnf :: PathType -> () #

Bounded PathType

Since: fs-utils-0.1

Instance details

Defined in FileSystem.PathType

Enum PathType

Since: fs-utils-0.1

Instance details

Defined in FileSystem.PathType

Generic PathType 
Instance details

Defined in FileSystem.PathType

Associated Types

type Rep PathType

Since: fs-utils-0.1

Instance details

Defined in FileSystem.PathType

type Rep PathType = D1 ('MetaData "PathType" "FileSystem.PathType" "fs-utils-0.1-539e06479b7c961598a9ab40b37c6d853cab165be3a31b07a164625401edfdce" '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)))

Methods

from :: PathType -> Rep PathType x #

to :: Rep PathType x -> PathType #

Show PathType

Since: fs-utils-0.1

Instance details

Defined in FileSystem.PathType

Eq PathType

Since: fs-utils-0.1

Instance details

Defined in FileSystem.PathType

Ord PathType

Since: fs-utils-0.1

Instance details

Defined in FileSystem.PathType

type Rep PathType

Since: fs-utils-0.1

Instance details

Defined in FileSystem.PathType

type Rep PathType = D1 ('MetaData "PathType" "FileSystem.PathType" "fs-utils-0.1-539e06479b7c961598a9ab40b37c6d853cab165be3a31b07a164625401edfdce" '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)))

displayPathType :: IsString a => PathType -> a Source #

String representation of PathType.

Since: fs-utils-0.1

Functions

throwIfWrongPathType :: forall (es :: [Effect]). (HasCallStack, PosixCompatFiles :> es) => String -> PathType -> FilePath -> Eff es () Source #

Throws IOException if the path does not exist or the expected path type does not match actual.

Since: 0.1

isPathType :: forall (es :: [Effect]). (HasCallStack, PosixCompatFiles :> es) => PathType -> FilePath -> Eff es 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 :: forall (es :: [Effect]). (HasCallStack, PosixCompatFiles :> es) => FilePath -> Eff es 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