From 1c6013276309ff9036b2d506dad9a1518300535a Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Sat, 18 Apr 2020 10:41:34 -0700 Subject: 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. --- share/txr/stdlib/path-test.tl | 7 +++---- txr.1 | 3 ++- 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 -- cgit v1.2.3