the ruby kernel#exit
takes status code argument. code corresponds exit(3)
c function call, c libraries provide predefined constants. using constants more readable using literal integers. macos exit(3)
man page says:
the c standard (iso/iec 9899:1999 (``iso c99'')) defines values 0, exit_success, , exit_failure possible values of status. cooperating processes may use other values; in program might called mail transfer agent, values described in sysexits(3) may used provide more information parent process.
does ruby provide constants correspond status codes such exit_success
quoted above? preferably in language itself, standard library or if nothing else ruby gem.
as stated in documentation kernel#exit
:
true
,false
of status means success , failure respectively.
more specifically:
exit(true)
(orexit
) correspondsexit_success
exit(false)
correspondsexit_failure
the underlying c code:
switch (status) { case qtrue: istatus = exit_success; break; case qfalse: istatus = exit_failure; break; // ... }
other values system dependent , therefore don't have constant in c standard.
Comments
Post a Comment