Re: [racket-users] subprocess failure (Windows-specific ?)

2020-02-08 Thread Bertrand Augereau
Of course ! Inter-OS APIs are such a pain. I think you do the right thing by explicitating the differences regarding various OSes on the scribbled doc page. Maybe just documenting that: * subprocess-pid retains the pid forever after the child has stopped running * subprocess-pid returns 0 (or inval

Re: [racket-users] subprocess failure (Windows-specific ?)

2020-02-08 Thread Matthew Flatt
At Sat, 8 Feb 2020 17:46:06 +0100, Bertrand Augereau wrote: > You're right, but wouldn't using the posix_spawn family have better > semantics, better performance, and would allow to unify between POSIX and > Windows behaviours nicely ? :) It's the usual problem: posix_spawn() doesn't quite support

Re: [racket-users] subprocess failure (Windows-specific ?)

2020-02-08 Thread Bertrand Augereau
Hi Matthew, > Currently, if fork() fails on Unix (e.g., because there are too many > processes), then `subprocess` will raise an exception. But if fork() > succeeds, then there's normally no way to communicate an error from > exec() except through the exit code, since exec() is in the child > pr

Re: [racket-users] subprocess failure (Windows-specific ?)

2020-02-08 Thread Matthew Flatt
At Sat, 8 Feb 2020 17:08:18 +0100, Bertrand Augereau wrote: > > I'm not sure I completely understand the problem. You're correct that > > there's no way to tell whether the value is an exit code from the program > > or an error from the operating system ... but there also is no way to tell > > tha

Re: [racket-users] subprocess failure (Windows-specific ?)

2020-02-08 Thread Bertrand Augereau
> I'm not sure I completely understand the problem. You're correct that > there's no way to tell whether the value is an exit code from the program > or an error from the operating system ... but there also is no way to tell > that starting the program from the shell IF you rely solely on the ex

Re: [racket-users] subprocess failure (Windows-specific ?)

2020-02-08 Thread George Neuner
On 2/8/2020 8:58 AM, Bertrand Augereau wrote: The 1st value returned by (subprocess) is an opaque reference to the executing process.  If you pass the reference to (subprocess-status) it will return *'running*  if the process currently is executing, or the exit/error value. "e

Re: [racket-users] subprocess failure (Windows-specific ?)

2020-02-08 Thread Bertrand Augereau
> The 1st value returned by (subprocess) is an opaque reference to the > executing process. If you pass the reference to (subprocess-status) it > will return *'running* if the process currently is executing, or the > exit/error value. > "exit/error value" is the issue there. (subprocess-st

Re: [racket-users] subprocess failure (Windows-specific ?)

2020-02-08 Thread George Neuner
On 2/8/2020 3:37 AM, Bertrand Augereau wrote:   : I spawn my subprocess with subprocess : https://docs.racket-lang.org/reference/subprocess.html And for the sake of completeness I want to know when suprocess failed (because the users tampered with the exe, because there's an ACL issue, whatev

[racket-users] subprocess failure (Windows-specific ?)

2020-02-08 Thread Bertrand Augereau
Hello everybody, I'm trying to drive a WIN32 application from a Racket gui app to provide the QA guys a simple way to interact with it. So far I'm quite successful but I'm having a little issue. I spawn my subprocess with subprocess : https://docs.racket-lang.org/reference/subprocess.html And f