{-# LINE 1 "src/System/Xattr/Types.hsc" #-} module System.Xattr.Types {-# LINE 2 "src/System/Xattr/Types.hsc" #-} ( -- * Data Types AttrName , XattrMode(RegularMode,CreateMode,ReplaceMode) ) where {-# LINE 10 "src/System/Xattr/Types.hsc" #-} {-# LINE 11 "src/System/Xattr/Types.hsc" #-} -- |Represents the mode for an update (i.e. set) operation data XattrMode = RegularMode -- ^ The attribute will be created if it does not yet exist, and replace the existing named attribute otherwise. | CreateMode -- ^ Specifies a pure create, which fails if the named attribute exists already. | ReplaceMode -- ^ Specifies a pure replace operation, which fails if the named attribute does not already exist. deriving (Eq, Show) instance Enum XattrMode where fromEnum RegularMode = 0 fromEnum CreateMode = 1 {-# LINE 22 "src/System/Xattr/Types.hsc" #-} fromEnum ReplaceMode = 2 {-# LINE 23 "src/System/Xattr/Types.hsc" #-} toEnum 0 = RegularMode toEnum 1 = CreateMode {-# LINE 25 "src/System/Xattr/Types.hsc" #-} toEnum 2 = ReplaceMode {-# LINE 26 "src/System/Xattr/Types.hsc" #-} -- |The name of an attribute. Some filesystems support arbitrarily long names, -- but for portability you're recommended to limit this to 255 bytes. type AttrName = String