New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

status code and stderr for %% #207

Closed
cvogt opened this Issue Aug 31, 2015 · 9 comments

Comments

Projects
None yet
2 participants
@cvogt
Contributor

cvogt commented Aug 31, 2015

Would be great if %% would return not only the stdout but also stderr and status code. Also, it seems %% is broken in that it terminates commands too early. I tried to use it with tar and ended up with empty or broken archives while % works fine, but writes all output to stdout.

@lihaoyi

This comment has been minimized.

Owner

lihaoyi commented Aug 31, 2015

Yeah, I haven't figured out how to make %% capture those other things, but I'm sure it's possible and I want to do it.

I wonder if the early-termination problem is something to do with not fully consuming the output Stream given by %% causing the background process to block and not make progress.

Do you have a nice self-contained repro of the problem I can add to my test suite? That'd make it easier to attack

@cvogt

This comment has been minimized.

Contributor

cvogt commented Aug 31, 2015

regarding the api, how about giving the return value a lazy member stderr for the error stream and a blocking member for the status code. Maybe it would be cleaner to make the stdout a member rather than the return value itself, too, but that may have other api implications I am not aware of. Never used the piping.

@lihaoyi

This comment has been minimized.

Owner

lihaoyi commented Sep 1, 2015

yeah seems reasonable. Some kind of structured data would be nice. The whole lazy-vs-strict thing is kinda still in flux; right now most things are strict, so we could make this strict as well and figure out how to make lazy things lazy later if we decide we care

@lihaoyi

This comment has been minimized.

Owner

lihaoyi commented Sep 22, 2015

If we end up with something more flexible to deal with the stdout and stderr of the subprocess, we should probably support all the "common" redirect operations, e.g. all those here:

http://tldp.org/HOWTO/Bash-Prog-Intro-HOWTO-3.html

@cvogt

This comment has been minimized.

Contributor

cvogt commented Sep 22, 2015

sounds good. structured data for what?

@lihaoyi

This comment has been minimized.

Owner

lihaoyi commented Sep 23, 2015

Structured data so we can access things like the output stream, error stream, exit code, and other things without having to have 100 different %%%%% operators to give us the individual bits we need

@cvogt

This comment has been minimized.

Contributor

cvogt commented Sep 23, 2015

agreed

@lihaoyi

This comment has been minimized.

Owner

lihaoyi commented Dec 1, 2015

Fixed by 5d7fb68, will go out in 0.5.1

@lihaoyi lihaoyi closed this Dec 1, 2015

@cvogt

This comment has been minimized.

Contributor

cvogt commented Dec 1, 2015

awesome :)!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment