xattr

package module
v1.1.2-0...-909c375 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2013 License: BSD-2-Clause Imports: 3 Imported by: 1

README

xattr

Package xattr provides a simple interface to user extended attributes on Linux and OSX.

Install it: go get github.com/AlekSi/xattr

Documentation is available on godoc.org.

License: Simplified BSD License (see LICENSE).

Documentation

Overview

Package xattr provides a simple interface to user extended attributes on Linux and OSX. Support for xattrs is filesystem dependant, so not a given even if you are running one of those operating systems.

On Linux you have to edit /etc/fstab to include "user_xattr". Also, Linux extended attributes have a manditory prefix of "user.". This is prepended transparently for Get/Set/Remove and hidden in List.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Get

func Get(path, attr string) ([]byte, error)

Retrieves extended attribute data associated with path.

func IsNotExist

func IsNotExist(err error) bool

Returns whether the error is known to report that a extended attribute does not exist.

func List

func List(path string) ([]string, error)

Retrieves a list of names of extended attributes associated with path.

func Remove

func Remove(path, attr string) error

Removes the extended attribute.

func Set

func Set(path, attr string, data []byte) error

Associates data as an extended attribute of path.

Types

type XAttrError

type XAttrError struct {
	Op   string
	Path string
	Attr string
	Err  error
}

XAttrError records an error and the operation, file path and attribute that caused it.

func (*XAttrError) Error

func (e *XAttrError) Error() string

Jump to

Keyboard shortcuts

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