summaryrefslogtreecommitdiffstats
path: root/txr.1
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2020-07-20 07:13:40 -0700
committerKaz Kylheku <kaz@kylheku.com>2020-07-20 07:13:40 -0700
commitd9afdbb32c0dd0b693e01b4204176d333805571b (patch)
treebb515cc1144e5de5127f332ac7f5a4a811192fa0 /txr.1
parent9cd58d83904fc531f214c3bc2f506c80d816f415 (diff)
downloadtxr-d9afdbb32c0dd0b693e01b4204176d333805571b.tar.gz
txr-d9afdbb32c0dd0b693e01b4204176d333805571b.tar.bz2
txr-d9afdbb32c0dd0b693e01b4204176d333805571b.zip
stat, lstat and dirstat now take struct param.
* ftw.c (ftw_callback): Pass nil to new parameter of stat_to_struct, to have a new stat struct allocated as before. * sysif.c (stat_to_struct, stat_impl, stat_wrap, lstat_wrap dirstat): New optional parameter that lets caller specify an existing struct object to fill. (sysif_init): Adjust registrations of stat, fstat, lstat and dirstat for new optional parameter. * sysif.h (stat_to_struct, stat_wrap): Declarations updated. * txr.1: Documented.
Diffstat (limited to 'txr.1')
-rw-r--r--txr.132
1 files changed, 25 insertions, 7 deletions
diff --git a/txr.1 b/txr.1
index e32cc3a9..e1c82a75 100644
--- a/txr.1
+++ b/txr.1
@@ -59755,9 +59755,9 @@ fields take on values of zero.
.coNP Functions @, stat @ lstat and @ fstat
.synb
-.mets (stat >> { path | < stream | << fd })
+.mets (stat >> { path | < stream | << fd } <> [ struct ])
.mets (lstat << path )
-.mets (fstat >> { path | stream | << fd })
+.mets (fstat >> { path | stream | << fd } <> [ struct ])
.syne
.desc
The
@@ -59780,9 +59780,22 @@ is thrown.
If the object is not found or cannot be
accessed, an exception is thrown.
-Otherwise, information is retrieved and returned, in the form
-of a structure of type
+
+Otherwise, if the
+.meta struct
+argument is missing, information is retrieved and returned, in the form of a
+new structure of type
.codn stat .
+If the
+.meta struct
+argument is present, it must be either: an instance of the
+.code struct
+structure type, or of a type derived from that type by inheritance, or
+else structure type which has all the same slots as the
+.code struct
+type. The retrieved information is stored into
+.meta struct
+and that object is returned rather than a new object.
If
.meta path
@@ -63129,7 +63142,7 @@ when the handle indicates that no more directory entries remain to be traversed.
.coNP Function @ dirstat
.synb
-.mets (dirstat < dirent-struct <> [ dir-path ])
+.mets (dirstat < dirent-struct >> [ dir-path <> [ struct ]])
.syne
.desc
The
@@ -63144,9 +63157,14 @@ sets the
.code type
slot of the
.meta dirent-struct
-accordingly, and also returns the
+accordingly, and then returns the value that
.code stat
-structure.
+returned.
+
+If the
+.meta struct
+argument is specified, it is passed to
+.codn stat .
The
.meta dir-path