From 83aea1f74dd3de219de053d9162f8b217b0530ca Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Thu, 16 Apr 2015 07:08:05 -0700 Subject: Adding chmod. * configure: Detect chmod. * sysif.c (chmod_wrap): New function. (sysif_init): Register chmod intrinsic. * txr.1: Documented. * tl.vim, txr.vim: Regenerated. --- txr.1 | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) (limited to 'txr.1') diff --git a/txr.1 b/txr.1 index 1b95285e..0319b491 100644 --- a/txr.1 +++ b/txr.1 @@ -24457,6 +24457,46 @@ and functions extract the minor and major device number from a combined device number. +.coNP Function @ mknod +.synb +.mets (chmod < path << mode ) +.syne +.desc +The +.code chmod +function changes the permissions of the filesystem objects +specified by +.metn path. +It is a direct wrapper for the POSIX C library function of the same name. + +The permissions are specified by +.metn mode , +an integer argument. + +The existing permissions may be obtained using the +.code stat +function. + +The function throws a +.code file-error +exception if an error occurs, otherwise it returns +.codn t. + +.TP* Example: +.cblk + ;; Set permissions of foo.txt to "rw-r--r--" + ;; (owner can read and write; group owner + ;; and other users can only read). + + ;; numerically: + (chmod "foo.txt" #o644) + + ;; symbolically: + (chmod "foo.txt" (logior s-irusr s-iwusr + s-irgrp + s-iroth)) +.cble + .coNP Function @ mknod .synb .mets (mknod < path < mode <> [ dev ]) -- cgit v1.2.3