et99
2024-08-16 18:28:47 UTC
Is there a good place to lookup the various error codes returned by tcl commands?
In the try command manual there's an example:
try {
set f [open /some/file/name w]
} 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"
}
How did the writer of this example know about these two error cases since they are not documented in the manual under either try or open.
Also, are POSIX error codes system independent?
In the try command manual there's an example:
try {
set f [open /some/file/name w]
} 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"
}
How did the writer of this example know about these two error cases since they are not documented in the manual under either try or open.
Also, are POSIX error codes system independent?