Documentation ¶
Index ¶
- Constants
- Variables
- func FDelXattr(file *os.File, key string) error
- func FGetXattr(file *os.File, key string) ([]byte, error)
- func FListXattrs(file *os.File) (map[string]struct{}, error)
- func FSetXattr(file *os.File, key string, value []byte) error
- func GetMimeType(filename string) string
- func GetXattr(path string, key string) ([]byte, error)
- func ListXattrs(path string) (map[string]struct{}, error)
- func MakeHole(file *os.File, start, len int64) error
- func SetXattr(path string, key string, value []byte) error
Constants ¶
View Source
const ( // XATTR_MAXNAMELEN comes from the maximal allowed key size that can be stored on ext, given the length is specified in u8 XATTR_MAXNAMELEN = 255 // nolint: golint // ENOATTR is the error code returned when an attribute doesn't exist ENOATTR = syscall.ENODATA // nolint: golint )
View Source
const (
// MimeTypeAttr is the key of the xattr for file mime types
MimeTypeAttr = "user.mime_type"
)
Variables ¶
View Source
var ErrInvalidKey = errors.New("Key Invalid")
ErrInvalidKey is returned when a key is 0 bytes, or otherwise considered as invalid
Functions ¶
func FListXattrs ¶
FListXattrs lists xattrs given a specific file handle
func GetMimeType ¶
GetMimeType tries to get the mime type for a given filename based on the xattr
func ListXattrs ¶
ListXattrs returns a set of all of the xattrs on a file
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.