misleading example in documentation of [try]
Closed / Fixed3603804fffffffffffffffffffffffffffffffffCreated 14 years agoUpdated 14 years ago
Descriptionplain2013-02-08 08:51:15
the documentation of the try command contains the following example:
try {
set f [open /some/file/name]
} trap {POSIX EISDIR} {} {
puts "failed to open /some/file/name: it's a directory"
} trap {POSIX ENOENT} {} {
puts "failed to open /some/file/name: it doesn't exist"
}
this (slightly) misleading, since (on unix) it is allowed to open a directory for reading, i.e. you will never get
the message "failed to open /some/file/name: it's a directory".
a simple fix would be to open for writing: "try { set f [open /some/file/name w] ......"
dkfplain2013-02-08 16:24:54
allow_comments - 1 Fair enough; fixed on trunk.
Log in (anonymous is fine) to add a comment.