pkg/xattr

Name: xattr

Owner: pkg

Description: Extended attribute support for Go (linux + darwin + freebsd)

Created: 2016-10-29 23:45:56.0

Updated: 2018-01-09 22:54:18.0

Pushed: 2017-08-08 19:02:15.0

Homepage: null

Size: 21

Language: Go

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

GoDoc Go Report Card Build Status

xattr

Extended attribute support for Go (linux + darwin + freebsd).

“Extended attributes are name:value pairs associated permanently with files and directories, similar to the environment strings associated with a process. An attribute may be defined or undefined. If it is defined, its value may be empty or non-empty.” See more…

Example
nst path = "/tmp/myfile"
nst prefix = "user."

 err := xattr.Set(path, prefix+"test", []byte("test-attr-value")); err != nil {
log.Fatal(err)


r list []string
 list, err = xattr.List(path); err != nil {
log.Fatal(err)


r data []byte
 data, err = xattr.Get(path, prefix+"test"); err != nil {
log.Fatal(err)


 err = xattr.Remove(path, prefix+"test"); err != nil {
log.Fatal(err)


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.