[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Enhancement for file-attributes
From: |
Juanma Barranquero |
Subject: |
Re: Enhancement for file-attributes |
Date: |
Mon, 1 Oct 2012 04:04:58 +0200 |
On Mon, Oct 1, 2012 at 3:16 AM, Stefan Monnier <address@hidden> wrote:
> It would have made a lot of sense originally, but I'm wondering whether
> it's worth the trouble now. In how many places would we save the
> file-chase-links all? Are these places important?
I don't know about that, but a way to ask file-attributes for a
specific value, instead of computing them all and consing them into a
list would perhaps make sense.
I recently counted uses of (nth X (file-attributes ...)), and
variants, like (car (file-attributes ...)) and (let ((atr
(file-attributes ...))) ...), etc. Asking for the file size happens >
110 times in the sources; last modification time, > 50; all the rest,
<10 each (approx, as I counted by hand).
So a function (file-size X) doing an optimized equivalent of (nth 7
(file-attributes (file-truename NAME))) would be useful, and cleaner
IMO.
Juanma