finished_ok multimethod

Methods

finished_ok(p:Process) Source: stdlib.ngs:4702
Decide whether process finished normally: exit code must be 0. Note that processes terminated by a signal will have .exit_code null.

Parameters

pany process

Returns

bool
finished_ok(p:Process)deprecated Source: stdlib.ngs:4710
Decide whether a process finished normally: OK for any process that has "nofail:" option

Example

$(nofail: ls no-such-file)
finished_ok(p:Process, field_name:Str, ok:NumRange)internal Source: stdlib.ngs:4719
Decide whether a process finished normally.

Example

$(ok:0..10 ls no-such-file)
finished_ok(p:Process, field_name:Str, ok:Arr)internal Source: stdlib.ngs:4725
Decide whether a process finished normally.

Example

$(ok:[0,1,2] ls no-such-file)
finished_ok(p:Process, field_name:Str, ok:Int)internal Source: stdlib.ngs:4733
Decide whether a process finished normally.

Example

$(ok:1 ls no-such-file)  # No exception
$(ok:10 ls no-such-file) # ProcessFail exception
finished_ok(p:Process, field_name:Str, ok:Bool)internal Source: stdlib.ngs:4739
Decide whether a process finished normally.

Example

# 'ok' option is set to true when the value is missing after ':'
$(ok: ls no-such-file)
finished_ok(p:Process)internal Source: stdlib.ngs:4749
Decide whether a process with 'ok' option finished normally.

Example

$(ok:0..10 ls no-such-file)
$(ok:[0,1,2] ls no-such-file)
$(ok:1 ls no-such-file)  # No exception
$(ok:10 ls no-such-file) # ProcessFail exception
$(ok: ls no-such-file)
finished_ok(p:Process) Source: stdlib.ngs:4764
Decide whether a process with 'ok_sig' option finished normally.

Example

p=$(sleep 10 &); p.kill(); p.wait()  # ProcessFail exception in wait()
p=$(ok_sig:SIGNALS.TERM sleep 10 &); p.kill(); p.wait()  # No exception
finished_ok(p:Process) Source: stdlib.ngs:4778
Decide whether a process finished normally for known programs that return also non-zero exit codes which do not signal a failure.

Example

$(test -f my_file_that_might_be_present)
$(fuser my_file)  # On Linux, exit code 1 means file is not used
finished_ok(program_name:Str, ok:Any)experimental Source: stdlib.ngs:4786
Undocumented