{"id":20427974,"url":"https://github.com/pkg/xattr","last_synced_at":"2025-05-15T13:08:06.979Z","repository":{"id":41045216,"uuid":"72315273","full_name":"pkg/xattr","owner":"pkg","description":"Extended attribute support for Go (linux + darwin + freebsd)","archived":false,"fork":false,"pushed_at":"2024-07-21T21:53:22.000Z","size":98,"stargazers_count":180,"open_issues_count":1,"forks_count":30,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-04-15T05:32:08.719Z","etag":null,"topics":["extended-attributes","golang","golang-library","linux-darwin-freebsd","system","xattr"],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pkg.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-10-29T23:45:56.000Z","updated_at":"2025-04-01T18:26:22.000Z","dependencies_parsed_at":"2024-02-08T23:45:53.356Z","dependency_job_id":"a1b57c26-e201-4ebe-b1c6-4f483c5f79fc","html_url":"https://github.com/pkg/xattr","commit_stats":null,"previous_names":[],"tags_count":18,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pkg%2Fxattr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pkg%2Fxattr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pkg%2Fxattr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pkg%2Fxattr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pkg","download_url":"https://codeload.github.com/pkg/xattr/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254346624,"owners_count":22055808,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["extended-attributes","golang","golang-library","linux-darwin-freebsd","system","xattr"],"created_at":"2024-11-15T07:23:26.188Z","updated_at":"2025-05-15T13:08:01.968Z","avatar_url":"https://github.com/pkg.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![GoDoc](https://godoc.org/github.com/pkg/xattr?status.svg)](http://godoc.org/github.com/pkg/xattr)\n[![Go Report Card](https://goreportcard.com/badge/github.com/pkg/xattr)](https://goreportcard.com/report/github.com/pkg/xattr)\n[![Build Status](https://github.com/pkg/xattr/workflows/build/badge.svg)](https://github.com/pkg/xattr/actions?query=workflow%3Abuild)\n[![Codecov](https://codecov.io/gh/pkg/xattr/branch/master/graph/badge.svg)](https://codecov.io/gh/pkg/xattr)\n\nxattr\n=====\nExtended attribute support for Go (linux + darwin + freebsd + netbsd + solaris).\n\n\"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...](https://en.wikipedia.org/wiki/Extended_file_attributes)\n\n`SetWithFlags` allows to additionally pass system flags to be forwarded to the underlying calls. FreeBSD and NetBSD do not support this and the parameter will be ignored.\n\nThe `L` variants of all functions (`LGet/LSet/...`) are identical to `Get/Set/...` except that they\ndo not reference a symlink that appears at the end of a path. See\n[GoDoc](http://godoc.org/github.com/pkg/xattr) for details.\n\n### Example\n```go\n  const path = \"/tmp/myfile\"\n  const prefix = \"user.\"\n\n  if err := xattr.Set(path, prefix+\"test\", []byte(\"test-attr-value\")); err != nil {\n  \tlog.Fatal(err)\n  }\n\n  var list []string\n  if list, err = xattr.List(path); err != nil {\n  \tlog.Fatal(err)\n  }\n\n  var data []byte\n  if data, err = xattr.Get(path, prefix+\"test\"); err != nil {\n  \tlog.Fatal(err)\n  }\n\n  if err = xattr.Remove(path, prefix+\"test\"); err != nil {\n  \tlog.Fatal(err)\n  }\n\n  // One can also specify the flags parameter to be passed to the OS.\n  if err := xattr.SetWithFlags(path, prefix+\"test\", []byte(\"test-attr-value\"), xattr.XATTR_CREATE); err != nil {\n  \tlog.Fatal(err)\n  }\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpkg%2Fxattr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpkg%2Fxattr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpkg%2Fxattr/lists"}