> >One thing I dislike about Python (for Gump) is we've not found a nicer way > >to timeout processes. One thing I dislike about Gump's implementation (for > >this part) is that it runs the program, not just detects it on the PATH - > >but this is 'cos since we had code to do this > > > what about the "type" command/built-in? Can we assume that either the > python execute command will always execute the command in bash or find > the "type" executable?
Nice idea. Not sure it is portable enough (for Microsoft) to be quite worth the effort, but maybe. I suspect there is a way to search a path for an executable, and that is how we ought implement it. Mind you, I could easily live w/ a *nix flavour that works nicer than Microsoft, since most of our big serves are *Nix. > >One things I dislike about > >pgrep is it doesn't kill grandchildren (a perfectly good attribute out > >outside of computing) -- so only kills the child shell, not even the main > >program below. That all said, it stops Gump from hanging. > > > > > ;) If you ensure that the group id is set for all children, then > wouldn't a pgrep -g id do the trick? I don't know how you would achieve > that with python, but in C you would use setgid(id); I once looked into group ids, thinking they might be the answer, but didn't/don't know enough about them to come up with a plan. I suspect that some fork/exec, along with this, and with popenN could do it (again, for *Nix) but I've not had time to work it out. Maybe we could write some test modules to do this stuff (portably) and test them in unit tests, and then work them in. Thanks for both ideas. regards Adam --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
