xattr

package
v0.0.0-...-81b1152 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 8, 2016 License: AGPL-3.0 Imports: 1 Imported by: 0

Documentation

Overview

Package xattr handles the manipulation of Linux extended attributes.

Index

Constants

View Source
const (

	// XAttrCreateOrReplace creates or update the xattr
	XAttrCreateOrReplace = iota

	// XAttrCreate is used to fail when the xattr already exists.
	XAttrCreate

	// XAttrReplace is used to fail when the xattr does not exist.
	XAttrReplace
)
View Source
const (
	// XAttrValueBufferSize specifies
	// the maximum length an xattr is truncated when getting it.
	XAttrValueBufferSize = 255
)

Variables

This section is empty.

Functions

func GetXAttr

func GetXAttr(path, name string) ([]byte, error)

GetXAttr returns the extended attribute value from the path.

func SetXAttr

func SetXAttr(path, name string, val []byte, flags int) error

SetXAttr add an extended attribute to path with a write polciy specified in the flags parameter. The flags argument can be used to refine the semantics of the operation. XATTR_CREATE specifies a pure create, which fails if the named attribute exists already. XATTR_REPLACE specifies a pure replace operation, which fails if the named attribute does not already exist. By default (no flags), the extended attribute will be created if need be, or will simply replace the value if the attribute exists.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL