posix-acl-0.2.0.1: Support for Posix ACL

Copyright© 2013-2014 Nicola Squartini
LicenseBSD3
MaintainerNicola Squartini <tensor5@gmail.com>
Stabilityexperimental
Portabilityportable
Safe HaskellSafe
LanguageHaskell2010

System.Posix.ACL

Contents

Description

Support for POSIX.1e Access Control Lists (ACL), defined in section 23 of the draft standard IEEE Std 1003.1e.

Synopsis

Documentation

data Permset Source #

A combination of read, write and execute permissions.

Constructors

Permset 

emptyPermset :: Permset Source #

No permission.

fullPermset :: Permset Source #

Read, write and execute permissions.

unionPermsets :: Permset -> Permset -> Permset Source #

Give a permission if any of the two arguments grant that permission.

intersectPermsets :: Permset -> Permset -> Permset Source #

Give a permission if both the arguments grant that permission.

data ACL Source #

Represent a valid ACL as defined in POSIX.1e. The Show instance is defined to output the Short Text Form of the ACL (see section 23.3.2 of IEEE Std 1003.1e), while the Read instance is defined to be able to parse both the long and short text form (read only parses valid ACLs).

Instances

longTextForm :: ACL -> String Source #

Convert an ACL to its Long Text Form (see section 23.3.1 of IEEE Std 1003.1e).

shortTextFrom :: ACL -> String Source #

Convert an ACL to its Short Text Form (see section 23.3.2 of IEEE Std 1003.1e).

Get and set ACLs

getACL :: FilePath -> IO ACL Source #

Retrieve the ACL from a file.

getDefaultACL :: FilePath -> IO (Maybe ACL) Source #

Retrieve the default ACL from a directory (return Nothing if there is no default ACL).

fdGetACL :: Fd -> IO ACL Source #

Retrieve the ACL from a file, given its file descriptor.

setACL :: FilePath -> ACL -> IO () Source #

Set the ACL for a file.

setDefaultACL :: FilePath -> ACL -> IO () Source #

Set the default ACL for a directory.

fdSetACL :: Fd -> ACL -> IO () Source #

Set the ACL for a file, given its file descriptor.

deleteDefaultACL :: FilePath -> IO () Source #

Delete the default ACL from a directory.

Call to acl_delete_def_file().