summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2020-04-18 10:41:34 -0700
committerKaz Kylheku <kaz@kylheku.com>2020-04-18 10:41:34 -0700
commitb147d0de47a5bb55c2c32e4ef2af53bdb619a51e (patch)
treeeca05504139f1658cabb3ef5007698cc7eb91cd2
parent21c99d4de03c9a90115abdf24344bf4ecc79575c (diff)
downloadtxr-b147d0de47a5bb55c2c32e4ef2af53bdb619a51e.tar.gz
txr-b147d0de47a5bb55c2c32e4ef2af53bdb619a51e.tar.bz2
txr-b147d0de47a5bb55c2c32e4ef2af53bdb619a51e.zip
path-testing functions: accept file descriptor.
* share/txr/stdlib/path-test.tl (do-path-test): Pass all argument types to statfun, except if they are of type stat. * txr.1: Documented.
-rw-r--r--share/txr/stdlib/path-test.tl7
-rw-r--r--txr.13
2 files changed, 5 insertions, 5 deletions
diff --git a/share/txr/stdlib/path-test.tl b/share/txr/stdlib/path-test.tl
index 4f589fef..b57e13dd 100644
--- a/share/txr/stdlib/path-test.tl
+++ b/share/txr/stdlib/path-test.tl
@@ -25,10 +25,9 @@
;; OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
(defun sys:do-path-test (statfun path testfun)
- [testfun (if (or (stringp path)
- (streamp path))
- (ignerr [statfun path])
- path)])
+ [testfun (if (typep path 'stat)
+ path
+ (ignerr [statfun path]))])
(eval-only
(defmacro sys:path-test ((sym statfun path) . body)
diff --git a/txr.1 b/txr.1
index c02d7fb3..242ef120 100644
--- a/txr.1
+++ b/txr.1
@@ -59244,10 +59244,11 @@ function except in the case of
.code path-symlink-p
which uses
.codn lstat .
-
If instead a stream is specified as
.metn path ,
then the associated filesystem descriptor is probed for these properties.
+If an integer value is specified, it is treated as a POSIX
+open file descriptor that is to be probed.
Otherwise, a
.code stat
structure, for example one returned by the