Re: shell return values
Bram Moolenaar <[email protected]>
| Newsgroups | gmane.comp.tools.aap.devel |
|---|---|
| Message-ID | <[email protected]> |
Lars Ivar Igesund wrote:
> Hmm, consider this code from Util.py; logged_system(). This shows
> that the return value from os.system() is dealt with also on winxp.
> In my case it returns 1. I see no reason why that should mean that
> an error happened. My program runs flawlessly (at least for the test
> in question), using D's printf (really the C printf) for the output.
It's not uncommon for programmers to forget about the exit value.
Mostly this is when main() returns without a value.
For programs like make and Aap the exit value is the only way to detect
whether an error occurred. Most compilers do return a valid exit code,
thus Aap uses this to decide whether compilation was successful. For
programs that do not have a valid exit code, you could complain to the
writer.
--
CRONE: Who sent you?
ARTHUR: The Knights Who Say Ni!
CRONE: Aaaagh! (she looks around in rear) No! We have no shrubberies here.
"Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD
/// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net \\\
/// Creator of Vim - Vi IMproved -- http://www.Vim.org \\\
\\\ Project leader for A-A-P -- http://www.A-A-P.org ///
\\\ Help AIDS victims, buy here: http://ICCF-Holland.org/click1.html ///
-------------------------------------------------------
This SF.net email is sponsored by: The SF.net Donation Program.
Do you like what SourceForge.net is doing for the Open
Source Community? Make a contribution, and help us add new
features and functionality. Click here: http://sourceforge.net/donate/