Re: Proposal: Checked subprocess calls

2016-11-06 Thread Chris Angelico
On Mon, Nov 7, 2016 at 7:15 AM, Peter Bortas wrote: > Chris: What you have seem generally useful, but it lies in a namespace > that will get a bit busy if we implement all the special cases as we > think of them. I have similar function not checked in that would > confuse users

Re: Proposal: Checked subprocess calls

2016-11-06 Thread Peter Bortas
We discussed this a bit during the Pike Conferance. These are my thoughts on it: On Mon, Oct 17, 2016 at 10:07 PM, Stephen R. van den Berg wrote: > Chris Angelico wrote: >>> // This leaves stdin and stdout and stderr unaltered >>> Process.pipe.run("fgrep -e

Re: Proposal: Checked subprocess calls

2016-10-17 Thread Stephen R. van den Berg
Chris Angelico wrote: >> // This leaves stdin and stdout and stderr unaltered >> Process.pipe.run("fgrep -e test").run("sort").run("wc"); >If Pike were a shell language, this would make sense. But I would much It would make sense, for any programming language, not only for shell languages.

Re: Proposal: Checked subprocess calls

2016-10-16 Thread Chris Angelico
On Sun, Oct 16, 2016 at 8:12 PM, Stephen R. van den Berg wrote: > Well, ok, fair enough. But then, try to improve on the interface and > preferably make it work like this: > (unless there already is an easy Pike-API for this, I'm not intimately > familiar with the Process-group) >

Re: Proposal: Checked subprocess calls

2016-10-16 Thread Stephen R. van den Berg
Chris Angelico wrote: >There's a strong convention that zero == success, nonzero == failure, >so this would apply as-is to a lot of programs. Obviously this >shouldn't be the one and only way to run a subprocess (this is NOT a >proposed change to Process.run, it's a separate function), so if you

Re: Proposal: Checked subprocess calls

2016-10-15 Thread Chris Angelico
On Sat, Oct 15, 2016 at 8:12 PM, Stephen R. van den Berg wrote: > Chris Angelico wrote: >>Two features added to the Process module. Firstly, a simple wrapper >>Process.check_run that calls Process.run and throws an error if the >>exit code isn't 0; > > This is a bit overkill, I'd

Re: Proposal: Checked subprocess calls

2016-10-15 Thread Stephen R. van den Berg
Chris Angelico wrote: >Two features added to the Process module. Firstly, a simple wrapper >Process.check_run that calls Process.run and throws an error if the >exit code isn't 0; This is a bit overkill, I'd say. It's not generic enough to put in the lib. What if you want to check for a certain