emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] master 8ca4228: Fdirectory_files_and_attributes doc string


From: Lars Ingebrigtsen
Subject: [Emacs-diffs] master 8ca4228: Fdirectory_files_and_attributes doc string clarification
Date: Thu, 31 May 2018 07:52:35 -0400 (EDT)

branch: master
commit 8ca42283939d458e30f74dce2bb1908257ea776f
Author: Lars Ingebrigtsen <address@hidden>
Commit: Lars Ingebrigtsen <address@hidden>

    Fdirectory_files_and_attributes doc string clarification
    
    * src/dired.c (Fdirectory_files_and_attributes): Clarify what data
    is returned.
---
 src/dired.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/src/dired.c b/src/dired.c
index c446223..115413d 100644
--- a/src/dired.c
+++ b/src/dired.c
@@ -358,6 +358,16 @@ If NOSORT is non-nil, the list is not sorted--its order is 
unpredictable.
 DEFUN ("directory-files-and-attributes", Fdirectory_files_and_attributes,
        Sdirectory_files_and_attributes, 1, 5, 0,
        doc: /* Return a list of names of files and their attributes in 
DIRECTORY.
+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 "/"))))
+
 There are four optional arguments:
 If FULL is non-nil, return absolute file names.  Otherwise return names
  that are relative to the specified directory.



reply via email to

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