From 64d3f8fcc8ef6e83e6fd789614e1aadfa526d18d Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Sun, 2 Aug 2015 08:44:33 -0700 Subject: Support lstat and fstat. * stream.h (statf): Declaration removed. * sysif.c (w_stat): Function takes val instead of const wchar_t * as leftmost argument. (w_lstat, w_fstat): New static functions, with same interface as w_stat. (stat_to_list, stat_impl): New static functions. (statp, statl): New static functions. (statf): Function removed, name re-used for new static function. (sysif_init): stat intrinsic registered to statp function, not statf. lstat and fstat intrinsics registered to statl and statf. * txr.1: Documented lstat and fstat. --- txr.1 | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) (limited to 'txr.1') diff --git a/txr.1 b/txr.1 index 2e6be395..6bf1344f 100644 --- a/txr.1 +++ b/txr.1 @@ -29074,9 +29074,11 @@ attempt. .SS* Unix Filesystem Manipulation -.coNP Function @ stat +.coNP Functions @, stat @, lstat and @ fstat .synb .mets (stat << path ) +.mets (lstat << path ) +.mets (fstat << stream ) .syne .desc The @@ -29106,6 +29108,32 @@ property has the same value as the .code st_dev field. +If +.meta path +refers to a symbolic link, the +.code stat +function retrieves information about the target of the link, if it exists, +or else throws an exception of type +.codn file-error . + +The +.code lstat +function behaves the same as +.code stat +or objects which are not symbolic links. For a symbolic link, it retrieves +information about the link itself, rather than its target. + +The +.code fstat +function retrieves information about the file system object associated with +the open stream +.metn stream . +The stream must be of a kind from which the +.code fileno +function can retrieve a file descriptor, otherwise an exception of type +.code file-error +is thrown. + .coNP Special variables @, s-ifmt @, s-iflnk @, s-ifreg @, s-ifblk ... , @ s-ixoth The following variables exist, having integer values. These are bitmasks -- cgit v1.2.3