diff options
author | Kaz Kyheku <kaz@kylheku.com> | 2020-01-15 20:07:06 -0800 |
---|---|---|
committer | Kaz Kyheku <kaz@kylheku.com> | 2020-01-15 20:07:06 -0800 |
commit | 267802c97c4a19354647eb96893429d5c67214df (patch) | |
tree | d326a40f3c5133de1c46e7e3489b65b80189a83a /txr.1 | |
parent | f76995965d0d8c5cff6885ff305c4f8b0cec524e (diff) | |
download | txr-267802c97c4a19354647eb96893429d5c67214df.tar.gz txr-267802c97c4a19354647eb96893429d5c67214df.tar.bz2 txr-267802c97c4a19354647eb96893429d5c67214df.zip |
chmod: work on streams and descriptors using fchmod.
* configure: extend chmod detection to cover fchmod.
* sysif.c (get_fd): New static functions.
(chmod_wrap): Include fchmod wrapping for integer
or stream argument.
(sysif_init): Register fchmod intrinsic.
Diffstat (limited to 'txr.1')
-rw-r--r-- | txr.1 | 29 |
1 files changed, 25 insertions, 4 deletions
@@ -57880,15 +57880,18 @@ from a combined device number. .coNP Function @ chmod .synb -.mets (chmod < path << mode ) +.mets (chmod < target << mode ) .syne .desc The .code chmod -function changes the permissions of the filesystem objects +function changes the permissions of the filesystem object specified by -.metn path . -It is a direct wrapper for the POSIX C library function of the same name. +.metn target . +It is implemented in terms of the POSIX functions +.code chmod +and +.codn fchmod . The permissions are specified by .metn mode , @@ -57903,6 +57906,24 @@ The function throws a exception if an error occurs, otherwise it returns .codn t . +The +.meta target +argument may be a character string, in which case it specifies a pathname in +the filesystem. In this case, the POSIX function +.code chmod +is invoked. + +The +.meta target +argument may also be an integer file descriptor, or a stream. In these two +cases, the POSIX +.code fchmod +function is invoked. For a stream +.metn target , +the integer file descriptor is retrieved from the stream using +.code fileno +function. + .TP* Example: .verb ;; Set permissions of foo.txt to "rw-r--r--" |