Skip to content

WIP: Add multi stream redirection

Michael Aaron Murphy requested to merge chrisvittal:multiple-redirect into master

Created by: chrisvittal

Add enum RedirectKind to consider three distinct cases of redirection.

1. No redirection [RedirectKind::None]
2. Single redirection [RedirectKind::Single(Redirection)]
3. Multiple redirections [RedirectKind::Multiple(Vec<Redirection>)]

The intention is to have the Single case work as it always has, and to use tempfiles of some kind to handle the the multiple output case.

What is still left to do:

  • Turning the memory mapped files into all the real files we need and making sure the following cases are handled.
    cmd args... > newfile >> appendedfile # no output (or error) redirection
    cmd args... >> output &> out-and-err # an output and a both out+err redirection
    • Furthermore, for long running commands, we would like commands like tail -f to work as well.
  • Redox support (there is currently only a stub)
  • (Possibly) reorganize it so that all platform specific code is internal to platform specific files

Fixes: #545 (closed)

State: WIP

Merge request reports