Re: try command error codes, where documented?

Liste des GroupesRevenir à cl tcl 
Sujet : Re: try command error codes, where documented?
De : et99 (at) *nospam* rocketship1.me (et99)
Groupes : comp.lang.tcl
Date : 17. Aug 2024, 08:09:08
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <v9piak$1qmrc$1@dont-email.me>
References : 1 2
User-Agent : Mozilla Thunderbird
On 8/16/2024 9:45 PM, greg wrote:
Am 16.08.24 um 20:28 schrieb et99:
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?
>
>
 Hello;
maybe this helps:
 https://www.tcl.tk/man/tcl8.6/TclCmd/tclvars.htm#M12
 source code tcl 8.6
./tcl8.6.14/win/tclWinError.c
/.tcl8.6.14/generic/tclPosixStr.c
  https://en.wikipedia.org/wiki/Errno.h
Thanks for the links.
I was afraid this was probably the only way to get the codes.
I think this could make a useful TIP - to add an error section to all command man pages as is done in the linux man pages.
If I were 30 years younger, with the inherent time and energy, I might have volunteered to do this, since it is obviously a tedious and perhaps thankless job.
I guess I will just stick to using my if-catch-template and not try to differentiate the particular errors. Besides, only I ever use my programs anymore :)
-e

Date Sujet#  Auteur
16 Aug 24 * try command error codes, where documented?7et99
17 Aug 24 `* Re: try command error codes, where documented?6greg
17 Aug 24  `* Re: try command error codes, where documented?5et99
19 Aug 24   `* Re: try command error codes, where documented?4Harald Oehlmann
21 Aug 24    `* Re: try command error codes, where documented?3et99
21 Aug 24     `* Re: try command error codes, where documented?2clt.to.davebr
22 Aug 24      `- Re: try command error codes, where documented?1et99

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal