digitalmars.D.learn - shell doesn't throw on error. Is that a regression?
- timotheecour (20/20) Feb 02 2013 The doc for std.process.shell says "If the process could not be
- Andrej Mitrovic (8/9) Feb 02 2013 The only unittest is unfortunately pretty bad:
- timotheecour (4/4) Feb 02 2013 here goes:
- timotheecour (4/8) Feb 02 2013 actually the new std.process pull request
The doc for std.process.shell says "If the process could not be started or exits with an error code, throws an exception." However on OSX I'm having a different kind of behavior. Isn't there a unittest to test this? --- import std.process; import std.stdio; void main(){ shell("asfasfasdfasdf"); writeln("ok"); } --- prints: in dmd.2.061 - 2.059: sh: asfasfasdfasdf: command not found ok in dmd.2.057: sh: asfasfasdfasdf: command not found std.exception.ErrnoException std/stdio.d(418): Could not close pipe `asfasfasdfasdf' (Undefined error: 0)
Feb 02 2013
On 2/3/13, timotheecour <thelastmammoth gmail.com> wrote:Isn't there a unittest to test this?The only unittest is unfortunately pretty bad: unittest { auto x = shell("echo wyda"); } Please feel free to file a bug: http://d.puremagic.com/issues/enter_bug.cgi?product=D
Feb 02 2013
here goes: http://d.puremagic.com/issues/show_bug.cgi?id=9444 please see my added comment in 9444 regarding capturing std err instead of displaying it.
Feb 02 2013
On Sunday, 3 February 2013 at 02:28:26 UTC, timotheecour wrote:here goes: http://d.puremagic.com/issues/show_bug.cgi?id=9444 please see my added comment in 9444 regarding capturing std err instead of displaying it.actually the new std.process pull request (http://forum.dlang.org/thread/k5uprq$obu$1 digitalmars.com) works well. I wonder when that'll get in master?
Feb 02 2013