linux-xattr-0.1.0.1: Read, set and list extended attributes

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

System.Linux.XAttr

Contents

Description

linux-xattr provides bindings to the Linux syscalls for reading and manipulating extended attributes (setxattr, getxattr, listxattr, ...). Each function in this module has two variants: one with the name prefixed by "l" and one prefixed by "fd". Both of these are identical to the original version except that the "l"-variant does not follow symbolic link but acts on the link itself, and the "fd"-variant take a file descriptor as argument rather than a FilePath.

Synopsis

Set extended attributes

setXAttr Source

Arguments

:: FilePath

target file

-> String

name of attribute to set

-> ByteString

value of attribute

-> IO () 

Set the value of an extended attribute.

lSetXAttr :: FilePath -> String -> ByteString -> IO () Source

Set the value of an extended attribute (do not follow symbolic links).

fdSetXAttr :: Fd -> String -> ByteString -> IO () Source

Set the value of an extended attribute.

Create extended attributes

createXAttr :: FilePath -> String -> ByteString -> IO () Source

Identical to setXAttr, but if the attribute already exists fail and set errno to EEXIST.

lCreateXAttr :: FilePath -> String -> ByteString -> IO () Source

Identical to lSetXAttr, but if the attribute already exists fail and set errno to EEXIST.

fdCreateXAttr :: Fd -> String -> ByteString -> IO () Source

Identical to fdSetXAttr, but if the attribute already exists fail and set errno to EEXIST.

Replace extended attributes

replaceXAttr :: FilePath -> String -> ByteString -> IO () Source

Identical to setXAttr, but if the attribute does not exist fail and set errno to ENOATTR.

lReplaceXAttr :: FilePath -> String -> ByteString -> IO () Source

Identical to lSetXAttr, but if the attribute does not exist fail and set errno to ENOATTR.

fdReplaceXAttr :: Fd -> String -> ByteString -> IO () Source

Identical to fdSetXAttr, but if the attribute does not exist fail and set errno to ENOATTR.

Retrive extended attributes

getXAttr Source

Arguments

:: FilePath

target file

-> String

name of the attribute

-> IO ByteString

value of the attribute

Get the value of an extended attribute.

lGetXAttr :: FilePath -> String -> IO ByteString Source

Get the value of an extended attribute (do not follow symbolic links).

fdGetXAttr :: Fd -> String -> IO ByteString Source

Get the value of an extended attribute.

List extended attributes

listXAttr Source

Arguments

:: FilePath

target file

-> IO [String]

list of attribute names

Get the list of attribute names associated with the given FilePath.

lListXAttr :: FilePath -> IO [String] Source

Get the list of attribute names associated with the given FilePath (do not follow symbolic links).

fdListXAttr :: Fd -> IO [String] Source

Get the list of attribute names associated with the given file descriptor.

Remove extended attributes

removeXAttr Source

Arguments

:: FilePath

target file

-> String

name of the attribute

-> IO () 

Remove an extended attribute from the given FilePath.

lRemoveXAttr :: FilePath -> String -> IO () Source

Remove an extended attribute from the given FilePath (do not follow symbolic links).

fdRemoveXAttr :: Fd -> String -> IO () Source

Remove an extended attribute from the given file descriptor.