Skip to content

Can the working group make libraries that help cli apps using pipes unknowingly use them correctly? #132

@i30817

Description

@i30817

I can't count the number of times i had this sequence

  1. 'i can use a named pipe here to save memory in interprocess communication'
  2. i send the write end to the cli app on the other process with its command line output option
  3. i try to open the read end
  4. i hang indefinitely because the writer end found something it didn't like so it exited with a error without bothering to open the writer end (so it was never closed, so EOF was never sent).
  5. i hack around it by introducing a buggy delay in the call of the process and before reading input from the pipe to see if the child process killed itself.

I was thinking the WG could 'encourage' this not to happen by providing a argparse equivalent where the easiest way to code a cli app ends with output files 'already open when you get them' and thus closed automatically on process end. Does this make sense?

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-ergonomicsArea: Ease of solving CLI related problems (e.g. filesystem interactions)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions