aboutsummaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authorLars Ingebrigtsen2016-03-04 13:39:07 +0000
committerLars Ingebrigtsen2016-03-04 15:33:38 +0000
commit2d5b20f68c194e7fec7b9602935fd95149e9b7c6 (patch)
tree4dc995ec41e242f4f0c2d431bcd129a5e2c40410 /doc
parent484967796755051c4045cdcc26b0d3d129cc72ad (diff)
downloademacs-2d5b20f68c194e7fec7b9602935fd95149e9b7c6.tar.gz
emacs-2d5b20f68c194e7fec7b9602935fd95149e9b7c6.zip
Add accessors for `file-attributes'
* doc/lispref/files.texi (File Attributes): Mention the accessors. * lisp/files.el (file-attribute-type) (file-attribute-link-number, file-attribute-user-id) (file-attribute-group-id, file-attribute-access-time) (file-attribute-modification-time) (file-attribute-change-time, file-attribute-size) (file-attribute-modes, file-attribute-inode-number) (file-attribute-device-number): New functions. * src/dired.c (Ffile_attributes): Mention the accessors (bug#22890).
Diffstat (limited to 'doc')
-rw-r--r--doc/lispref/files.texi82
1 files changed, 46 insertions, 36 deletions
diff --git a/doc/lispref/files.texi b/doc/lispref/files.texi
index 6b7ee19d5f3..8a6cb7beaad 100644
--- a/doc/lispref/files.texi
+++ b/doc/lispref/files.texi
@@ -1195,73 +1195,83 @@ the default, but we plan to change that, so you should specify a
1195non-@code{nil} value for @var{id-format} if you use the returned 1195non-@code{nil} value for @var{id-format} if you use the returned
1196@acronym{UID} or @acronym{GID}. 1196@acronym{UID} or @acronym{GID}.
1197 1197
1198Accessor functions are provided to access the elements in this list.
1199The accessors are mentioned along with the descriptions of the
1200elements below.
1201
1198The elements of the list, in order, are: 1202The elements of the list, in order, are:
1199 1203
1200@enumerate 0 1204@enumerate 0
1201@item 1205@item
1202@code{t} for a directory, a string for a symbolic link (the name 1206@code{t} for a directory, a string for a symbolic link (the name
1203linked to), or @code{nil} for a text file. 1207linked to), or @code{nil} for a text file
1208(@code{file-attribute-type}).
1204 1209
1205@c Wordy so as to prevent an overfull hbox. --rjc 15mar92 1210@c Wordy so as to prevent an overfull hbox. --rjc 15mar92
1206@item 1211@item
1207The number of names the file has. Alternate names, also known as hard 1212The number of names the file has (@code{file-attribute-link-number}).
1208links, can be created by using the @code{add-name-to-file} function 1213Alternate names, also known as hard links, can be created by using the
1209(@pxref{Changing Files}). 1214@code{add-name-to-file} function (@pxref{Changing Files}).
1210 1215
1211@item 1216@item
1212The file's @acronym{UID}, normally as a string. However, if it does 1217The file's @acronym{UID}, normally as a string
1213not correspond to a named user, the value is a number. 1218(@code{file-attribute-user-id}). However, if it does not correspond
1219to a named user, the value is a number.
1214 1220
1215@item 1221@item
1216The file's @acronym{GID}, likewise. 1222The file's @acronym{GID}, likewise (@code{file-attribute-group-id}).
1217 1223
1218@item 1224@item
1219The time of last access, as a list of four integers @code{(@var{sec-high} 1225The time of last access, as a list of four integers
1220@var{sec-low} @var{microsec} @var{picosec})}. (This is similar to the 1226@code{(@var{sec-high} @var{sec-low} @var{microsec} @var{picosec})}
1221value of @code{current-time}; see @ref{Time of Day}.) Note that on 1227(@code{file-attribute-access-time}). (This is similar to the value of
1222some FAT-based filesystems, only the date of last access is recorded, 1228@code{current-time}; see @ref{Time of Day}.) Note that on some
1223so this time will always hold the midnight of the day of last access. 1229FAT-based filesystems, only the date of last access is recorded, so
1230this time will always hold the midnight of the day of last access.
1224 1231
1225@cindex modification time of file 1232@cindex modification time of file
1226@item 1233@item
1227The time of last modification as a list of four integers (as above). 1234The time of last modification as a list of four integers (as above)
1228This is the last time when the file's contents were modified. 1235(@code{file-attribute-modification-time}). This is the last time when
1236the file's contents were modified.
1229 1237
1230@item 1238@item
1231The time of last status change as a list of four integers (as above). 1239The time of last status change as a list of four integers (as above)
1232This is the time of the last change to the file's access mode bits, 1240(code{file-attribute-status-change-time}). This is the time of the
1233its owner and group, and other information recorded in the filesystem 1241last change to the file's access mode bits, its owner and group, and
1234for the file, beyond the file's contents. 1242other information recorded in the filesystem for the file, beyond the
1243file's contents.
1235 1244
1236@item 1245@item
1237The size of the file in bytes. This is floating point if the size is 1246The size of the file in bytes (@code{file-attribute-size}). This is
1238too large to fit in a Lisp integer. 1247floating point if the size is too large to fit in a Lisp integer.
1239 1248
1240@item 1249@item
1241The file's modes, as a string of ten letters or dashes, 1250The file's modes, as a string of ten letters or dashes, as in
1242as in @samp{ls -l}. 1251@samp{ls -l} (@code{file-attribute-modes}).
1243 1252
1244@item 1253@item
1245An unspecified value, present for backward compatibility. 1254An unspecified value, present for backward compatibility.
1246 1255
1247@item 1256@item
1248The file's inode number. If possible, this is an integer. If the 1257The file's inode number (@code{file-attribute-inode-number}). If
1249inode number is too large to be represented as an integer in Emacs 1258possible, this is an integer. If the inode number is too large to be
1250Lisp but dividing it by @math{2^{16}} yields a representable integer, 1259represented as an integer in Emacs Lisp but dividing it by
1251then the value has the 1260@math{2^{16}} yields a representable integer, then the value has the
1252form @code{(@var{high} . @var{low})}, where @var{low} holds the low 16 1261form @code{(@var{high} . @var{low})}, where @var{low} holds the low 16
1253bits. If the inode number is too wide for even that, the value is of the form 1262bits. If the inode number is too wide for even that, the value is of
1254@code{(@var{high} @var{middle} . @var{low})}, where @code{high} holds 1263the form @code{(@var{high} @var{middle} . @var{low})}, where
1255the high bits, @var{middle} the middle 24 bits, and @var{low} the low 1264@code{high} holds the high bits, @var{middle} the middle 24 bits, and
125616 bits. 1265@var{low} the low 16 bits.
1257 1266
1258@item 1267@item
1259The filesystem number of the device that the file is on. Depending on 1268The filesystem number of the device that the file is on
1260the magnitude of the value, this can be either an integer or a cons 1269@code{file-attribute-device-number}). Depending on the magnitude of
1261cell, in the same manner as the inode number. This element and the 1270the value, this can be either an integer or a cons cell, in the same
1262file's inode number together give enough information to distinguish 1271manner as the inode number. This element and the file's inode number
1263any two files on the system---no two files can have the same values 1272together give enough information to distinguish any two files on the
1264for both of these numbers. 1273system---no two files can have the same values for both of these
1274numbers.
1265@end enumerate 1275@end enumerate
1266 1276
1267For example, here are the file attributes for @file{files.texi}: 1277For example, here are the file attributes for @file{files.texi}: