// ProcessState contains information about an exited process, // available after a call to Wait or Run. ProcessState *os.ProcessState
So it looks like I can't actually check the status of a process I
Start()ed while it's still running?
It makes no sense to me
ProcessState is set when the process exits. There's an ProcessState.Exited() method which will always return
true in this case.
So I tried to go this route instead:
cmd.Process.Pid field exists right after I
cmd.Start(), however it looks like os.Process doesn't expose any mechanisms to check if the process is running.
On Unix systems, FindProcess always succeeds and returns a Process for the given pid, regardless of whether the process exists.
which isn't useful –and it seems like there's no way to go from os.Process to an os.ProcessState unless you
.Wait() which defeats the whole purpose (I want to know if the process is running or not before it has exited).