unix-compat-0.4.1.1: Portable POSIX-compatibility layer.

Safe HaskellSafe-Inferred

System.PosixCompat.Files

Contents

Description

This module makes the operations exported by System.Posix.Files available on all platforms. On POSIX systems it re-exports operations from System.Posix.Files. On other platforms it emulates the operations as far as possible.

/NOTE: the portable implementations are not well tested, in some cases functions are only stubs./

Synopsis

File modes

unionFileModes :: FileMode -> FileMode -> FileMode

intersectFileModes :: FileMode -> FileMode -> FileMode

nullFileMode :: FileMode

ownerReadMode :: FileMode

ownerWriteMode :: FileMode

ownerExecuteMode :: FileMode

ownerModes :: FileMode

groupReadMode :: FileMode

groupWriteMode :: FileMode

groupExecuteMode :: FileMode

groupModes :: FileMode

otherReadMode :: FileMode

otherWriteMode :: FileMode

otherExecuteMode :: FileMode

otherModes :: FileMode

setUserIDMode :: FileMode

setGroupIDMode :: FileMode

stdFileMode :: FileMode

accessModes :: FileMode

Setting file modes

setFileMode :: FilePath -> FileMode -> IO ()

setFdMode :: Fd -> FileMode -> IO ()

setFileCreationMask :: FileMode -> IO FileMode

Checking file existence and permissions

fileAccess :: FilePath -> Bool -> Bool -> Bool -> IO Bool

fileExist :: FilePath -> IO Bool

File status

Obtaining file status

getFileStatus :: FilePath -> IO FileStatus

Querying file status

deviceID :: FileStatus -> DeviceID

fileID :: FileStatus -> FileID

fileMode :: FileStatus -> FileMode

linkCount :: FileStatus -> LinkCount

fileOwner :: FileStatus -> UserID

fileGroup :: FileStatus -> GroupID

fileSize :: FileStatus -> FileOffset

accessTime :: FileStatus -> EpochTime

isSocket :: FileStatus -> Bool

Creation

createNamedPipe :: FilePath -> FileMode -> IO ()

createDevice :: FilePath -> FileMode -> DeviceID -> IO ()

Hard links

createLink :: FilePath -> FilePath -> IO ()

removeLink :: FilePath -> IO ()

Symbolic links

createSymbolicLink :: FilePath -> FilePath -> IO ()

readSymbolicLink :: FilePath -> IO FilePath

Renaming files

rename :: FilePath -> FilePath -> IO ()

Changing file ownership

setOwnerAndGroup :: FilePath -> UserID -> GroupID -> IO ()

setFdOwnerAndGroup :: Fd -> UserID -> GroupID -> IO ()

setSymbolicLinkOwnerAndGroup :: FilePath -> UserID -> GroupID -> IO ()

Changing file timestamps

setFileTimes :: FilePath -> EpochTime -> EpochTime -> IO ()

touchFile :: FilePath -> IO ()

Setting file sizes

setFileSize :: FilePath -> FileOffset -> IO ()

setFdSize :: Fd -> FileOffset -> IO ()

Find system-specific limits for a file

getPathVar :: FilePath -> PathVar -> IO Limit

getFdPathVar :: Fd -> PathVar -> IO Limit