diff options
author | dkf <donal.k.fellows@manchester.ac.uk> | 2007-07-04 13:25:53 (GMT) |
---|---|---|
committer | dkf <donal.k.fellows@manchester.ac.uk> | 2007-07-04 13:25:53 (GMT) |
commit | 726415ce000fd8fd519c61d004b3fb673977ef50 (patch) | |
tree | 9bdb4e78ebe8fe9ed13ff9265ae7379467f14fd9 | |
parent | ef369d0c5ca00cc8fad599ea3c4dfc7df33e442f (diff) | |
download | tcl-726415ce000fd8fd519c61d004b3fb673977ef50.zip tcl-726415ce000fd8fd519c61d004b3fb673977ef50.tar.gz tcl-726415ce000fd8fd519c61d004b3fb673977ef50.tar.bz2 |
Minor formatting fixes and additional notes on portability of [file]
-rw-r--r-- | doc/file.n | 10 | ||||
-rw-r--r-- | doc/filename.n | 13 |
2 files changed, 10 insertions, 13 deletions
@@ -5,7 +5,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: file.n,v 1.43 2007/04/05 14:08:40 dkf Exp $ +'\" RCS: @(#) $Id: file.n,v 1.44 2007/07/04 13:25:53 dkf Exp $ '\" .so man.macros .TH file n 8.3 Tcl "Tcl Built-In Commands" @@ -427,8 +427,11 @@ Returns \fB1\fR if file \fIname\fR is writable by the current user, .TP \fBUnix\fR\0\0\0\0\0\0\0 . -These commands always operate using the real user and group identifiers, -not the effective ones. +The subcommands that test whether a particular mode of access is permitted +always operate using the real user and group identifiers, not the effective +ones. As such, robust code should just \fBopen\fR a file for reading instead +of testing to see whether it is readable with \fBfile readable\fR. This also +avoids potential race conditions. .SH EXAMPLES This procedure shows how to search for C files in a given directory that have a correspondingly-named object file in the current @@ -470,6 +473,5 @@ if {![\fBfile isdirectory\fR [\fBfile dirname\fR $newName]]} { .SH "SEE ALSO" chan(n), close(n), eof(n), fblocked(n), filename(n), flush(n), gets(n), open(n), seek(n), tell(n) - .SH KEYWORDS attributes, copy files, delete files, directory, file, move files, name, rename files, stat diff --git a/doc/filename.n b/doc/filename.n index d7dda13..c0bad63 100644 --- a/doc/filename.n +++ b/doc/filename.n @@ -4,7 +4,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: filename.n,v 1.14 2006/05/24 10:31:27 dkf Exp $ +'\" RCS: @(#) $Id: filename.n,v 1.15 2007/07/04 13:25:54 dkf Exp $ '\" .so man.macros .TH filename n 7.5 Tcl "Tcl Built-In Commands" @@ -25,7 +25,6 @@ to be portable should not assume a particular form for file names. Instead, portable scripts must use the \fBfile split\fR and \fBfile join\fR commands to manipulate file names (see the \fBfile\fR manual entry for more details). - .SH "PATH TYPES" .PP File names are grouped into three general types based on the starting point @@ -38,13 +37,12 @@ qualified, either giving the path relative to the root directory on the current volume, or relative to the current directory of the specified volume. The \fBfile pathtype\fR command can be used to determine the type of a given path. - .SH "PATH SYNTAX" .PP The rules for native names depend on the value reported in the Tcl array element \fBtcl_platform(platform)\fR: .TP 10 -\fBunix\fR +\fBUnix\fR On Unix and Apple MacOS X platforms, Tcl uses path names where the components are separated by slashes. Path names may be relative or absolute, and file names may contain any character other than slash. @@ -55,10 +53,10 @@ separator. Any number of trailing slash characters at the end of a path are simply ignored, so the paths \fBfoo\fR, \fBfoo/\fR and \fBfoo//\fR are all identical, and in particular \fBfoo/\fR does not necessarily mean a directory is being referred. +.RS .PP The following examples illustrate various forms of path names: -.RS .TP 15 \fB/\fR Absolute path to the root directory. @@ -82,7 +80,7 @@ Relative path to the file \fBfoo\fR in the directory above the current directory. .RE .TP -\fBwindows\fR +\fBWindows\fR On Microsoft Windows platforms, Tcl supports both drive-relative and UNC style names. Both \fB/\fR and \fB\e\fR may be used as directory separators in either type of name. Drive-relative names consist of an optional drive @@ -122,7 +120,6 @@ Volume-relative path to a file \fBfoo\fR in the root directory of the current volume. This is not a valid UNC path, so the assumption is that the extra backslashes are superfluous. .RE - .SH "TILDE SUBSTITUTION" .PP In addition to the file name rules described above, Tcl also supports @@ -143,7 +140,6 @@ file. The behaviour of these paths when not trying to interpret them is the same as on Unix. File names that have a tilde without a user name will be correctly substituted using the \fB$HOME\fR environment variable, just like for Unix. - .SH "PORTABILITY ISSUES" .PP Not all file systems are case sensitive, so scripts should avoid code @@ -172,6 +168,5 @@ illegal. .SH KEYWORDS current directory, absolute file name, relative file name, volume-relative file name, portability - .SH "SEE ALSO" file(n), glob(n) |