summaryrefslogtreecommitdiffstats
path: root/txr.1
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2020-02-04 23:25:16 -0800
committerKaz Kylheku <kaz@kylheku.com>2020-02-04 23:25:16 -0800
commitc554db7ce82378612673e33d905b29f2d820a1a5 (patch)
tree8d9bd08470b1d68004f1d2c0ecf749800cb1c8b1 /txr.1
parent5601100718f5647f2cc317c504af8b2470bad5a1 (diff)
downloadtxr-c554db7ce82378612673e33d905b29f2d820a1a5.tar.gz
txr-c554db7ce82378612673e33d905b29f2d820a1a5.tar.bz2
txr-c554db7ce82378612673e33d905b29f2d820a1a5.zip
stat and fstat become equivalent.
* sysif.c (get_fd): Move this function higher in the file to avoid forward declarations. The do_fstatt code being moved into do_stat needs to call it. (do_stat): Provide stat and fstat functionality in one function. (do_fstat): Static function removed. (fstat_wrap): Call do_stat instead of do_fstat. * txr.1: Updated.
Diffstat (limited to 'txr.1')
-rw-r--r--txr.179
1 files changed, 49 insertions, 30 deletions
diff --git a/txr.1 b/txr.1
index 8c588ae6..1461062d 100644
--- a/txr.1
+++ b/txr.1
@@ -57742,10 +57742,9 @@ The
.code stat
structure defines the type of object which is returned
by the
-.codn stat ,
-.codn lstat ,
+.code stat
and
-.code fstat
+.code lstat
functions. Except for
.codn path ,
.codn atime-nsec ,
@@ -57788,21 +57787,33 @@ fields take on values of zero.
.coNP Functions @, stat @ lstat and @ fstat
.synb
-.mets (stat << path )
+.mets (stat > { path | < stream | << fd })
.mets (lstat << path )
-.mets (fstat > { stream | << fd })
+.mets (fstat > { path | stream | << fd })
.syne
.desc
The
.code stat
-function inquires the filesystem about the existence of an object
-denoted by the string
-.metn path .
+function retrieves information about a filesystem object whose pathname
+is given by the string argument
+.metn path ,
+or else about a system object associated with the open stream
+.metn stream ,
+or one associated with the integer file descriptor
+.metn fd .
+
+If a
+.meta stream
+is specified, that 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.
+
If the object is not found or cannot be
accessed, an exception is thrown.
-
-Otherwise, information is retrieved about the object. The information takes
-the form of a structure of type
+Otherwise, information is retrieved and returned, in the form
+of a structure of type
.codn stat .
If
@@ -57817,35 +57828,43 @@ The
.code lstat
function behaves the same as
.code stat
-or objects which are not symbolic links. For a symbolic link, it retrieves
+on 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
-.meta stream
-or numeric file descriptor
-.metn fd .
-If a
-.meta stream
-is specified, that 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.
-
-The
.code path
slot of the returned structure
holds a copy of their
.meta path
argument value.
-In the case of
-.codn fstat ,
-this slot is
+When information is retrieved using a
+.meta stream
+or
+.meta fd
+argument, this slot is
.codn nil .
+The
+.code fstat
+function is an alias for
+.codn stat .
+
+Note: until \*(TX 231,
+.code stat
+and
+.code fstat
+were distinct functions:
+.code stat
+accepted only
+.meta path
+arguments, whereas
+.code fstat
+function accepted only
+.meta stream
+or
+.meta fd
+arguments.
+
.coNP Variables @, s-ifmt @, s-iflnk @, s-ifreg @, s-ifblk ... , @ s-ixoth
.desc
The following variables exist, having integer values. These are bitmasks