XAttr provides bindings to the glibc function for reading and manipulating extended attributes (setxattr, getxattr, listxattr, ...).
Each function in this module has two variants: the one with the name prefixed by "l" and "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.
- setXAttr :: FilePath -> String -> String -> IO ()
- lSetXAttr :: FilePath -> String -> String -> IO ()
- fdSetXAttr :: Fd -> String -> String -> IO ()
- createXAttr :: FilePath -> String -> String -> IO ()
- lCreateXAttr :: FilePath -> String -> String -> IO ()
- fdCreateXAttr :: Fd -> String -> String -> IO ()
- replaceXAttr :: FilePath -> String -> String -> IO ()
- lReplaceXAttr :: FilePath -> String -> String -> IO ()
- fdReplaceXAttr :: Fd -> String -> String -> IO ()
- getXAttr :: FilePath -> String -> IO String
- lGetXAttr :: FilePath -> String -> IO String
- fdGetXAttr :: Fd -> String -> IO String
- listXAttr :: FilePath -> IO [String]
- lListXAttr :: FilePath -> IO [String]
- fdListXAttr :: Fd -> IO [String]
- removeXAttr :: FilePath -> String -> IO ()
- lRemoveXAttr :: FilePath -> String -> IO ()
- fdRemoveXAttr :: Fd -> String -> IO ()
Set extended attributes
setXAttr sets the value of an extended attribute.
Create extended attributes
createXAttr :: FilePath -> String -> String -> IO ()Source
createXAttr is identical to setXAttr, but if the attribute already exists it fails and sets errno to EEXIST.
Replace extended attributes
replaceXAttr :: FilePath -> String -> String -> IO ()Source
replaceXAttr is identical to setXAttr, but if the attribute does not exist it fails and sets errno to ENOATTR.
Retrive extended attributes
getXAttr retrieves the value of an extended attribute
List extended attributes
listXAttr retrieves the list of attribute names associated with the given filepath.
lListXAttr :: FilePath -> IO [String]Source
fdListXAttr :: Fd -> IO [String]Source
Remove extended attributes
removeXAttr removes an extended attribute from the give filepath.