Skip to content

Return streams from getStdOut, getStdIn, and getStdErr #3823

@jayschwa

Description

@jayschwa

In the Zig codebase (and in my own, what little that is), almost every call to these functions immediately performs [in|out]Stream().stream. If getStdOut and friends just returned the streams directly, that would probably DRY a lot of code. Perhaps getStdOutFile could be added for less common use-cases.

Exceptions I found in Zig codebase:

  • stdout_file.write() in a couple places, but OutStream has write too.
  • cat_file in a test takes fs.Files, but it looks like it's implementation is only concerned with a read and write method on its arguments, and would probably not be hard to change.

Metadata

Metadata

Assignees

No one assigned

    Labels

    proposalThis issue suggests modifications. If it also has the "accepted" label then it is planned.standard libraryThis issue involves writing Zig code for the standard library.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions