Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Extended attributes (module and article)



On 11 January 2012 21:52, Micah Elliott <mde@xxxxxxxxxxxxxxxx> wrote:
> Hi! I was peeking at the `zsh/attr` module docs and trying to figure
> out why it exists. Is it significantly different from the standard
> getfattr/setfattr/attr utils (which already have nice completions and
> look more featureful)? Does it serve to abstract say Linux's xattr and
> Mac's xattr systems? I'm really only using Linux, but I guess that
> could be a reason to use the zsh module.

I wrote it for use with the *(e::) globbing syntax, where calling out
to an external binary for hundreds/thousands of files is just way way
too slow. eg

#usage, *(e:fattr name:) or *(e:fattr name value:)
function fattr() {
  local val
  zgetattr $REPLY user.$1 val 2>/dev/null
  [[ -n "$val" && ( -z "$2" || "$val" =~ "$2" ) ]]
}


-- 
Mikael Magnusson



Messages sorted by: Reverse Date, Date, Thread, Author