]> git.eshelyaron.com Git - emacs.git/commitdiff
Fdirectory_files_and_attributes doc string clarification
authorLars Ingebrigtsen <larsi@gnus.org>
Thu, 31 May 2018 11:51:45 +0000 (13:51 +0200)
committerLars Ingebrigtsen <larsi@gnus.org>
Thu, 31 May 2018 11:52:32 +0000 (13:52 +0200)
* src/dired.c (Fdirectory_files_and_attributes): Clarify what data
is returned.

src/dired.c

index c446223a0bcab80c0e45a46e55a5a5082c6bf328..115413dd6bc51578ac7502169d3200c4fffa1b4c 100644 (file)
@@ -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.