Example #1
0
File: attrs.go Project: mildred/doc
func Get(path, name string) ([]byte, error) {
	res, err := xattr.Get(path, name)
	if IsErrno(err, syscall.ENOTSUP) {
		res, err = getAttr(path, name)
		if err != nil {
			err = syscall.ENODATA
		}
	}
	return res, err
}
Example #2
0
File: attrs.go Project: mildred/doc
// Return a lit of attribute names and a list of their values
func GetList(path string) ([]string, [][]byte, error) {
	var val []byte
	list, err := GetNameList(path)
	values := make([][]byte, len(list))
	if err != nil {
		return nil, nil, err
	}
	for i, key := range list {
		val, err = xattr.Get(path, key)
		if err != nil {
			return nil, nil, err
		}
		values[i] = val
	}
	return list, values, nil
}