* Future of `[set-]file-extended-attributes'?
@ 2013-12-28 4:27 Chong Yidong
2013-12-28 9:13 ` Eli Zaretskii
0 siblings, 1 reply; 2+ messages in thread
From: Chong Yidong @ 2013-12-28 4:27 UTC (permalink / raw)
To: emacs-devel
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.
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Future of `[set-]file-extended-attributes'?
2013-12-28 4:27 Future of `[set-]file-extended-attributes'? Chong Yidong
@ 2013-12-28 9:13 ` Eli Zaretskii
0 siblings, 0 replies; 2+ messages in thread
From: Eli Zaretskii @ 2013-12-28 9:13 UTC (permalink / raw)
To: Chong Yidong; +Cc: emacs-devel
> From: Chong Yidong <cyd@gnu.org>
> 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.
> [...]
> 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.
These are all good questions, IMO, but I don't think we have enough
data points to answer them, or even discuss them intelligently at this
time. It is entirely not clear to me why should Emacs Lisp programs
bother about the details of these attributes, except to try preserving
them when copying files (in which case their exact contents and form
is not important). Even displaying them in a directory listing is not
yet widespread enough to be expected by users. And it's not like we
are going to support writing OS kernels in Emacs Lisp in the
observable future.
So I think what we have now is generic enough for us to be able to
extend it in the future, if the need arises. For now, I think we have
what we need (and more).
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-12-28 9:13 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-12-28 4:27 Future of `[set-]file-extended-attributes'? Chong Yidong
2013-12-28 9:13 ` Eli Zaretskii
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.