From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Lars Ingebrigtsen Newsgroups: gmane.emacs.devel Subject: Re: emacs-26 99f92da: Improve documentation of 'directory-files-and-attributes' Date: Fri, 01 Jun 2018 12:21:49 +0200 Message-ID: References: <20180601082809.7179.74843@vcs0.savannah.gnu.org> <20180601082810.7BF3721297@vcs0.savannah.gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1527848430 30744 195.159.176.226 (1 Jun 2018 10:20:30 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 1 Jun 2018 10:20:30 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: Eli Zaretskii To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Jun 01 12:20:26 2018 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fOhAW-0007sA-Og for ged-emacs-devel@m.gmane.org; Fri, 01 Jun 2018 12:20:24 +0200 Original-Received: from localhost ([::1]:54622 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fOhCd-0004PT-UA for ged-emacs-devel@m.gmane.org; Fri, 01 Jun 2018 06:22:35 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:38712) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fOhC2-0004PA-1B for emacs-devel@gnu.org; Fri, 01 Jun 2018 06:21:59 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fOhC1-0002w4-3I for emacs-devel@gnu.org; Fri, 01 Jun 2018 06:21:58 -0400 Original-Received: from hermes.netfonds.no ([80.91.224.195]:45840) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fOhBx-0002uC-70; Fri, 01 Jun 2018 06:21:53 -0400 Original-Received: from cm-84.212.221.165.getinternet.no ([84.212.221.165] helo=stories) by hermes.netfonds.no with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1fOhBu-0006ag-3J; Fri, 01 Jun 2018 12:21:52 +0200 Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAD1BMVEVsLhQvEAmAUh+JmC6U QRvjOw+NAAACO0lEQVQ4jU1UgZHDMAiDJANA0gFie4HELOD8ef+ZXrLb/ueu6RUZsCSoOB/DR0TO JdLi9wgJw4gp3hpX5OSXfQAe3hTfUSP7Ebv+A3rHr72W6hFH+gBunY8fNRPwPAEbCXjautqxRKhN YEb5xHoTuEwJ2DajyLujJJQKn8CMN6QfEdXWiHuU+laStt5AiBL4VGJSQZmysxYpDKAJr4fD6A84 EWB4UpVA/XwDtjQBxJn3ICFSkCKAvxZdEa9nCJq/AfEvEBlK3hBFtja0EjW0InDVSHtW6SPe2IvX LdctUNHokL9Gocf9xq2KX2rLEPEbt1LivHbw3gcwG0OBRgfTHmuGgkIG7I/3AHyNNZH5NqsgvrWl rsPa6+0S3w2YHvWsBt5lH0Aj+LSmVlY5aMe+nvJ1A0JKlJuq1z1nYRG02Rq6PHd9W5tcZTTGV2+m BwcB9G8zHTz0pdvjWyuw9prWJgr7+IMrAf9nrQoKeYcqLzSjtYXWnrgJVKRYjfJ/rd3VxKdYDrU6 jTqDFJPJ1BZZrfdp7fJnLU+zyczImB5ai5Eb7Prz0NpCa488eDRq/ur2RImS0xJ+wloIolsDppvC 2lrs0p3Wctjby5gipdTz3i83m3vZKbG8rQXLknUA42IKSZzr7OgzrPUxhg+IPH5ia0HvOP0zPmK8 mx/XWaEhx2oup9Krx1opsh7cDvvs+RgVSJITVb/n1jKtC3zqP7BWnT7p5w9AX2O+Di7s3LSRIbL8 nBv3o+I4PLlw+heDop5TaayOJAAAAABJRU5ErkJggg== In-Reply-To: <20180601082810.7BF3721297@vcs0.savannah.gnu.org> (Eli Zaretskii's message of "Fri, 1 Jun 2018 04:28:10 -0400 (EDT)") X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 80.91.224.195 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:225888 Archived-At: eliz@gnu.org (Eli Zaretskii) writes: > +Value is a list of the form: > + > + ((FILE1 FILE1-ATTRS) (FILE2 FILE2-ATTRS) ...) > + > +where each FILEn-ATTRS is the attributes of FILEn as returned > +by `file-attributes'. Heh, I read the same reddit post, apparently, and fixed it like this on master: +The list returned has elements that contain the data from +`file-attributes' for each file -- with the file name prepended. So +the structure of each element is +`(FILE-NAME FILE-ATTRIBUTE1 FILE-ATTRIBUTE2 ...)'. + +For instance, to get the size of the fourth element in a directory, +you could say: + + (file-attribute-size (cdr (nth 3 (directory-files-and-attributes "/")))) + Because (FILE1 FILE1-ATTRS) is a bit ambiguous, since it could mean ("file-name" (t 27 0 0 (23311 56666 366991 953000) (23220 586 761023 102000) (23220 586 761023 102000) 4096 "drwxr-xr-x" t 2 66306)) instead of ("file-name" t 27 0 0 (23311 56666 366991 953000) (23220 586 761023 102000) (23220 586 761023 102000) 4096 "drwxr-xr-x" t 2 66306) -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no