summaryrefslogtreecommitdiffstats
path: root/txr.1
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2023-09-12 23:53:38 -0700
committerKaz Kylheku <kaz@kylheku.com>2023-09-12 23:53:38 -0700
commitae81e1d90f90fbb74ffb1a71dde80f7f285506df (patch)
treed52d39ce68ca635e412ce8ceee0458425a3fbe53 /txr.1
parent910294bcb183aa31de761c39f500d21d9448bd67 (diff)
downloadtxr-ae81e1d90f90fbb74ffb1a71dde80f7f285506df.tar.gz
txr-ae81e1d90f90fbb74ffb1a71dde80f7f285506df.tar.bz2
txr-ae81e1d90f90fbb74ffb1a71dde80f7f285506df.zip
chdir: support stream and fd argument via fchdir.
* configure: new test for fchdir resulting in HAVE_FCHDIR. * sysif.c (get_fd): Define for HAVE_FCHDIR also. (chdir_wrap): If HAVE_FCHDIR, handle non-string arguments via fchdir, with help of get_fd. * txr.1: Documented.
Diffstat (limited to 'txr.1')
-rw-r--r--txr.121
1 files changed, 17 insertions, 4 deletions
diff --git a/txr.1 b/txr.1
index 83b82a28..dde521b6 100644
--- a/txr.1
+++ b/txr.1
@@ -72513,17 +72513,30 @@ instead of
.coNP Function @ chdir
.synb
-.mets (chdir << path )
+.mets (chdir >> { path | < stream | << fd })
.syne
.desc
.code chdir
-changes the current working directory to
-.metn path ,
-and returns
+changes the current working directory to the object specified
+by the argument, and returns
.metn t ,
or else throws an exception of type
.codn file-error .
+If the argument is a string, it is interpreted as a
+.metn path ,
+in which case the POSIX
+.code chdir
+function is used. If the argument is a
+.meta stream
+then an integer file descriptor is retrieved from that stream using the
+.code fileno
+function. That descriptor can be specified directly as a
+.meta fd
+argument. In the case of these these two argument types, the
+.code fchdir
+function is used.
+
.coNP Function @ pwd
.synb
.mets (pwd)