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

stat module



Here's a zsh module which implements a builtin `stat' command as a
front end to the `stat' system call; the tar file contains the module,
a YODL manual page and a function zll which implements ls -l entirely
within the shell (with no new processes).  I have not attempted to
integrate these into the zsh hierarchy, though you can simply move
stat.c to Src/Modules and type `make stat.so'.

I wrote this mainly because I thought that getting the properties of
files was just the sort of thing one needs quickly for compctl and (in
future) zle functions.  However, this turns out to be essentially moot
since the rest of zsh runs so slowly:  you can stat a hundred files in
a flash but it takes an age (say) to find out which of the dates is
the most recent.  Try `zll *' and you will see what I mean.

Nonetheless, it may be nice to have such capabilities within the shell
as a counterpart to Zefram's files module.

There's an external stat in IRIX; I didn't try and make it compatible
because I thought my syntax for selecting particular stat elements was
much clearer.

begin 644 stat.tar.gz
M'XL(`(6N)C,``^Q<?7/;-I/OO]*G0-0XDFS)D1(G:>PGR;AYJZ^VTXG=IW=-
M/2XE@A(O%,D2I%6YS7WV^^TN0%*R['.?:?K,S523L400V%TL%OL*Y#**OOC<
MG^%@\'AG1WVAU,Y@YP%]JX>/G_`W?8:#G8%2CQ\.AX\>/$%?;GGRY`LU^.R4
MX5.8W,N4^B*=FQO[_5)X?A:.;^[T_^_SI;J,(M7IJM^:7RH3SM)(JS#.=19[
MD6I'1O6CMBI,&$]4/M4*S,K5+/&+2.^I.%%)FH=);+:;S0\?U-T?3[XY_^?K
M]R<'[X[5G6?JX?9P4YV=J7OW5)H!J&I][?GJ0F<&8UKJ^3WU@xxxxx^R6`V;
MS4M`CA+TZ8>"Z???:V^!H7^I[@XM2*-SM=EL1LD8E`;<OYDO4DWM_??JH8JC
M,/Y8-1VJKU01^FH2^O5^7V'6E[K9#)(,4,)8W=UL^DF3!)-)Z)M#U=^WO]^H
MUL9(;?AJXYO=C:.6ZJN[`1$Y3N(\C`N`H7&,^-E=&O)AYTQQ&S#;ED>V95*V
M/+8M1(AM^@I-W":,Z\>JWU<M>??P3-UE%.HNS>?NA/[06"7OG^)]T.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9WAMQ8J:)
M.FYA['G#6X)"&$3:K>)/:0B0D+><Z8]NA*VWX4P4K/E3*90?J4'W\I%F0CY$
M`NJU&,*7M1N%$=0ZMN$/I2%]QG3$Z<!M[."I'L$-`RL\\.>?9;3C.YY6?:6*
M(@M?>'ZHIV=33[&+WW]&\Y\:L_S<HSOTTT/9KTZ*+%`-\\S?\V#9^E$<QFL?
MFCUY2:-TETUX01*6.S6,<GAZPUK8_L1GFC\JTR-J3`03(UQ]N>3=\_?R83J,
M%W?#^__U(4$BD4@D$HE$(I%()!*)1"*12"02B40BD4@D$HE$(I%()/XY_`):
'>WL.`'@``$$B
`
end

-- 
Peter Stephenson <pws@xxxxxx>       Tel: +49 33762 77366
WWW:  http://www.ifh.de/~pws/       Fax: +49 33762 77413
Deutsches Elektronen-Synchrotron --- Institut fuer Hochenergiephysik Zeuthen
DESY-IfH, 15735 Zeuthen, Germany.



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