emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Future of `[set-]file-extended-attributes'?


From: Chong Yidong
Subject: Future of `[set-]file-extended-attributes'?
Date: Sat, 28 Dec 2013 12:27:51 +0800

I wonder how future-proof the `file-extended-attributes' and
`set-file-extended-attributes' functions, new to Emacs 24.4, are.

The names of these functions imply that they provide an Emacs Lisp
interface for retrieving and setting extended attributes.  Actually,
they are currently just wrappers for the special cases of ACLs and
SELinux contexts, which have special OS interfaces.

In the future, we may want to provide an Emacs Lisp interface to handle
arbitrary attributes.  Currently, `set-file-extended-attributes' has
the form:

  (set-file-extended-attributes FILENAME ATTRIBUTES)

ATTRIBUTES is expected to be an alist like

 ((acl . ACL) (selinux-context . SEL-CONTEXT))

where ACL and SEL-CONTEXT seem to have some non-trivial structure not
corresponding directly to the actual extended attributes to be set.
That's because they are set via the special interfaces for ACLs
(acl_set_file) and SELinux contexts (context_*_set), not the general
interface for setting extended file attributes (setxattr).

Is there a plan for extending `set-file-extended-attributes' to set an
extended attribute, with a particular namespace, name, and value?  I
guess we could each element in ATTRIBUTES could be one of

  (SYMBOL . SPECIALLY-FORMATTED-ATTRIBUTES)
  (NAME-STRING VALUE [FLAGS])

where the first form is what we currently have and the second form would
be for setting general attributes.  Thoughts?

I also wonder if it might not be cleaner to have a singular
`set-file-extended-attribute' function instead.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]