emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: `file-attribute' accessors


From: Ted Zlatanov
Subject: Re: `file-attribute' accessors
Date: Mon, 09 Apr 2012 11:46:01 -0400
User-agent: Gnus/5.130004 (Ma Gnus v0.4) Emacs/24.0.95 (gnu/linux)

On Mon, 09 Apr 2012 16:40:51 +0200 Lars Magne Ingebrigtsen <address@hidden> 
wrote: 

LMI> Thierry Volpiatto <address@hidden> writes:
>> Why not keys instead of many accessor functions?

LMI> Because `file-attributes' already has an optional parameter, and one
LMI> sometimes wants to have, say, both the uid and the size, and statting
LMI> the file twice to get that isn't optimal.

I would extend `file-attributes' to take &rest symbols after the extra
format argument, so you could say

(file-attributes FILE nil 'size 'mtime)

And you'd get back a two-element list.  I think that's the most concise
approach: it doesn't create a bunch of new functions, scales from one
attribute to N or "just give me all", and is backwards compatible.

Ted




reply via email to

[Prev in Thread] Current Thread [Next in Thread]