Use system to start a server then execute commands on it



Hi,

I have a script set up that allows me to execute a seperate process
(start a perfoce server) and then call against it.

e.g.

system( "cmd to start perforce server &" );
... sometime later within the same script ...
`some cmd on perforce server`;

The problem is `some cmd` reacts as if the original system call had not
been made (i.e. as if perforce is not running). If I run a seperate
terminal and sleep between the calls I can see that the perforce server
has been properly started and I can call commands on the server;
however once the sleep expires `some cmd` still fails. `some cmd`
works as expected if the perforce server has been started externally to
the script (as in subsequent runs)

I have searched docs, tried fork (which didn't do what I wanted) and
I'm a bit stuck.
Any help appreciated.

Thanks,
James.

.



Relevant Pages

  • Re: Same Internal Server Error from last two days
    ... I am trying to run a Hello World Perl Script in Apache 2.2. ... But its constantly giving me Internal Server Error.The script ... # have to place corresponding `LoadModule' lines at this location so the ...
    (perl.beginners)
  • Re: Same Internal Server Error from last two days
    ... I am trying to run a Hello World Perl Script in Apache 2.2. ... But its constantly giving me Internal Server Error.The script Runs perfectly fine from the command prompt. ... # This is the main Apache HTTP server configuration file. ... LoadModule actions_module modules/mod_actions.so ...
    (perl.beginners)
  • Same Internal Server Error from last two days
    ... I am trying to run a Hello World Perl Script in Apache 2.2. ... But its constantly giving me Internal Server Error.The script ... # have to place corresponding `LoadModule' lines at this location so the ...
    (perl.beginners)
  • Re: How can I kill a stuck cmd.exe remotely?
    ... sample script code... ... Microsoft MVP - Windows Server Management Infrastructure ... > the cmd would stuck for some reasons I did not know. ... > something in order to run the WMI thing? ...
    (microsoft.public.windowsxp.wmi)
  • Re: Regarding a selection for mobile code/scripting language
    ... Client Side scripting, so the server can send script commands to the client. ... I decided they should be scripted and mobile code. ...
    (Vuln-Dev)