Skip to content

processchain wait/wait_success issues #3846

Closed
@swadey

Description

@swadey

I'd like to run a process chain and wait for it to finish. Unfortunately it looks like:

  1. wait is not defined for process chains, and
  2. wait_success uses success() which defines success like this:
proc.exit_code==0 && (proc.term_signal == 0 || proc.term_signal == SIGPIPE)

Unfortunately, grep defines success as 0 or 1 (sigh):

EXIT STATUS
     The grep utility exits with one of the following values:

     0     One or more lines were selected.
     1     No lines were selected.
     >1    An error occurred.

Here's an example:

julia> x = readsfrom(`ls` |> `grep xxxxxx`)
(NamedPipe(closed, 0 bytes waiting),ProcessChain([Process(`ls`, ProcessExited(0)),Process(`grep xxxxxx`, ProcessExited(1))],SpawnNullStream(),NamedPipe(closed, 0 bytes waiting),TTY(open, 0 bytes waiting)))

julia> wait(x[2])
ERROR: no method wait(ProcessChain,)

julia> Base.wait_success(x[2])
false

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions