ATTR_REMOVE(3)
π ATTR_REMOVE(3) π
okay bestie, welcome to the XFS Compatibility API corner of section 3 of the manual β yes, that's the (3) in the title, we're in library-call territory, not commands. sit down, grab a strawberry π, and let's talk about deleting attributes.
β¨ NAME β¨
attr_remove, attr_removef β remove a user attribute of a filesystem object. yeah. that's the whole gig. deleting vibes only π
πΈ C SYNOPSIS πΈ
#include <attr/attributes.h>
int attr_remove (const char *path, const char *attrname, int flags);
int attr_removef (int fd, const char *attrname, int flags);
look at her. two functions, one dream. β¨
π¦ DESCRIPTION π¦
so basically, attr_remove and attr_removef give you a way to remove attributes that were previously created from filesystem objects. like, the attribute was there, it had a moment, it served looks, and now it's leaving the group chat. π
path points to a path name for a filesystem object, and fd refers to the file descriptor associated with a file. if the attribute attrname exists, the attribute name and value will be removed from the filesystem object. both of them. name and value. the whole fit. π
the flags argument can contain the following symbols bitwise OR'ed together:
ATTR_ROOTβ look forattrnamein the root address space, not in the user address space. > heads up bestie: this one is limited to use by super-user only. super-user energy, no gatekeeping. πATTR_DONTFOLLOWβ do not follow symbolic links when resolving a path on anattr_removefunction call. the default is to follow symbolic links. so if you don't say anything, she's following. she's always following. π§
π attr_remove will fail if one or more of the following are true π
[ENOATTR]β the attribute name given is not associated with the indicated filesystem object. (nothing to remove, nothing to slay, empty handed π)[ENOENT]β the named file does not exist. girl. where. where is she. π[EPERM]β the effective user ID does not match the owner of the file and the effective user ID is not super-user.[ENOTDIR]β a component of the path prefix is not a directory.[EACCES]β search permission is denied on a component of the path prefix.[EINVAL]β a bit was set in the flag argument that is not defined for this system call.[EFAULT]βpathpoints outside the allocated address space of the process.[ELOOP]β a path name lookup involved too many symbolic links.[ENAMETOOLONG]β the length ofpathexceeds{MAXPATHLEN}, or a pathname component is longer than{MAXNAMELEN}.
π attr_removef will fail if π
[ENOATTR]β the attribute name given is not associated with the indicated filesystem object.[EINVAL]β a bit was set in the flag argument that is not defined for this system call, orfdrefers to a socket, not a file. not me accidentally passing a socket π[EFAULT]βattrnamepoints outside the allocated address space of the process.[EBADF]βfddoes not refer to a valid descriptor.
β DIAGNOSTICS β
on success, zero is returned. on error, -1 is returned, and errno is set appropriately. that's it. that's the vibe check. β¨
π«Ά SEE ALSO π«Ά
iykyk, the whole extended attributes friendship circle π
and that's a wrap, bestie! this page came from the Extended Attributes era, dated Dec 2001, and the source/version line is literally just Extended Attributes β so yeah, she's vintage, she's iconic, she's still holding it down. periodt. π ππ
π¦ where this page comes from
- alpine 3.22: attr-doc 2.5.2-r2 Β· LGPL-2.1-or-later
- alpine 3.23: attr-doc 2.5.2-r2 Β· LGPL-2.1-or-later
- alpine 3.24: attr-doc 2.5.2-r2 Β· LGPL-2.1-or-later
- arch rolling: attr 2.6.0-1 Β· LGPL-2.1-or-later AND GPL-2.0-or-later
- centos-stream 10: libattr-devel 2.6.0-2.el10 Β· LGPL-2.1-or-later
- centos-stream 9: libattr-devel 2.6.0-2.el9 Β· LGPLv2+
- centos-stream 9: libattr-devel 2.6.0-2.el9 Β· LGPLv2+
- debian bookworm: libattr1-dev 1:2.5.1-4
- fedora 43: libattr-devel 2.5.2-6.fc43 Β· LGPL-2.1-or-later
- fedora 43: libattr-devel 2.5.2-6.fc43 Β· LGPL-2.1-or-later
- fedora 43: libattr-devel 2.6.0-1.fc43 Β· LGPL-2.1-or-later
- fedora 43: libattr-devel 2.6.0-1.fc43 Β· LGPL-2.1-or-later
- fedora 44: libattr-devel 2.5.2-8.fc44 Β· LGPL-2.1-or-later
- fedora 44: libattr-devel 2.5.2-8.fc44 Β· LGPL-2.1-or-later
- fedora 44: libattr-devel 2.6.0-1.fc44 Β· LGPL-2.1-or-later
- fedora 44: libattr-devel 2.6.0-1.fc44 Β· LGPL-2.1-or-later
- nixpkgs unstable: attr 2.6.0
- opensuse-leap 16.0: libattr-devel 2.6.0-160000.1.1 Β· GPL-2.0-or-later AND LGPL-2.1-or-later
- opensuse-leap 16.0: libattr-devel 2.6.0-160000.1.1 Β· GPL-2.0-or-later AND LGPL-2.1-or-later
- opensuse-leap 16.0: libattr-devel 2.6.0-160000.1.1 Β· GPL-2.0-or-later AND LGPL-2.1-or-later
- opensuse-leap 16.0: libattr-devel 2.6.0-160000.1.1 Β· GPL-2.0-or-later AND LGPL-2.1-or-later
- ubuntu noble: libattr1-dev 1:2.5.2-1build1
- ubuntu noble: libattr1-dev 1:2.5.2-1ubuntu0.1
- Copyright (C) 2001, 2002, 2003, 2006 Silicon Graphics, Inc
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms