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

Re: zsh/stat: output file birth time under Linux



2021-06-14 14:50:19 -0400, Phil Pennock:
[...]
> I think the tricky decision is what to do about setting an numerically
> indexed array instead of printing or setting an associative array.
[...]

I agree. There's a risk users do things like:

zstat -nLA a -- *
printf 'File: %s\n dev: %s...\n target: %15$s\n' "$a[@]"

Or

while (( $#a )); do
  print -r -- $a[1] $a[4] ...
  shift 15 a
done

(though in practice those behave poorly when any of the
(l)stat()s fails, so users would be more likely to run zstat in
a loop).

Or:

zstat -LA s link
print -r target: $s[-1]

-- 
Stephane




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