summaryrefslogtreecommitdiffstats
path: root/doc/file.n
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2022-09-25 19:34:28 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2022-09-25 19:34:28 (GMT)
commitca650aeafcb2e11e5c20ffacb727e9ec8b6cb7ce (patch)
tree17851054d8149329797333296388bebe51117668 /doc/file.n
parent33195f9318b46186be7801d1a05bfee3f03c529b (diff)
parentceb4d1ae2e8ce79d4e499fd8763990f3e1ac67e5 (diff)
downloadtcl-ca650aeafcb2e11e5c20ffacb727e9ec8b6cb7ce.zip
tcl-ca650aeafcb2e11e5c20ffacb727e9ec8b6cb7ce.tar.gz
tcl-ca650aeafcb2e11e5c20ffacb727e9ec8b6cb7ce.tar.bz2
TIP #594: Modernize "file stat" interface
Diffstat (limited to 'doc/file.n')
-rw-r--r--doc/file.n37
1 files changed, 19 insertions, 18 deletions
diff --git a/doc/file.n b/doc/file.n
index daa0ad8..bb6a7d3 100644
--- a/doc/file.n
+++ b/doc/file.n
@@ -269,14 +269,14 @@ symbolic and hard links (the latter for files only). Windows
supports symbolic directory links and hard file links on NTFS drives.
.RE
.TP
-\fBfile lstat \fIname varName\fR
+\fBfile lstat \fIname ?varName?\fR
.
Same as \fBstat\fR option (see below) except uses the \fIlstat\fR
kernel call instead of \fIstat\fR. This means that if \fIname\fR
-refers to a symbolic link the information returned in \fIvarName\fR
-is for the link rather than the file it refers to. On systems that
-do not support symbolic links this option behaves exactly the same
-as the \fBstat\fR option.
+refers to a symbolic link the information returned is for the link
+rather than the file it refers to. On systems that do not support
+symbolic links this option behaves exactly the same as the
+\fBstat\fR option.
.TP
\fBfile mkdir\fR ?\fIdir\fR ...?
.
@@ -411,19 +411,20 @@ that use the third component do not attempt to perform tilde
substitution.
.RE
.TP
-\fBfile stat \fIname varName\fR
-.
-Invokes the \fBstat\fR kernel call on \fIname\fR, and uses the variable
-given by \fIvarName\fR to hold information returned from the kernel call.
-\fIVarName\fR is treated as an array variable, and the following elements
-of that variable are set: \fBatime\fR, \fBctime\fR, \fBdev\fR, \fBgid\fR,
-\fBino\fR, \fBmode\fR, \fBmtime\fR, \fBnlink\fR, \fBsize\fR, \fBtype\fR,
-\fBuid\fR. Each element except \fBtype\fR is a decimal string with the
-value of the corresponding field from the \fBstat\fR return structure;
-see the manual entry for \fBstat\fR for details on the meanings of the
-values. The \fBtype\fR element gives the type of the file in the same
-form returned by the command \fBfile type\fR. This command returns an
-empty string.
+\fBfile stat \fIname ?varName?\fR
+.
+Invokes the \fBstat\fR kernel call on \fIname\fR, and returns a
+dictionary with the information returned from the kernel call. If
+\fIvarName\fR is given, it uses the variable to hold the information.
+\fIVarName\fR is treated as an array variable, and in such case the
+command returns the empty string. The following elements are set:
+\fBatime\fR, \fBctime\fR, \fBdev\fR, \fBgid\fR, \fBino\fR, \fBmode\fR,
+\fBmtime\fR, \fBnlink\fR, \fBsize\fR, \fBtype\fR, \fBuid\fR. Each element
+except \fBtype\fR is a decimal string with the value of the corresponding
+field from the \fBstat\fR return structure; see the manual entry for
+\fBstat\fR for details on the meanings of the values. The \fBtype\fR
+element gives the type of the file in the same form returned by the
+command \fBfile type\fR.
.TP
\fBfile system \fIname\fR
.