spawn

POSIX_SPAWN with Java?

ProcessBuilder.start and Runtime.exec seem to use fork() on *NIX system, which seems to allocate the child process the same amount of memory as the parent process (see e.g. this question ). This can be painful if you want to launch a process which needs almost no memory from a process that uses lots of memory. Is there any way to laun...

Spawn a process with php doesn't work

Hi, I tried to start a background process with php, for that, I added a & at bottom on exec function but after a few days it stop working. Basically If i have file 1.php with: <?php var_dump(exec('/home/2.php > /home/2.output 2>&1 &')); And file 2.php with: <?php sleep(5); echo "Fill\n"; Running file 1.php, it return an empty st...

basic python server using spawn/threads....

Hi. Got a problem that I'm facing. and it should be pretty simple. I have an app that places data into a dir "A". The data will be a series of files. I want to have a continually running server, that does a continual look at the dir, and on seeing a completed file in the dir, the server spawns/forks/creates a thread (not sure of the e...

Storing spawn information for 2d platformer/scroller

I'm looking for some idea's how best to store spawn information for a side scroller. The game I'm writing is very similar to Super Mario Bros. What I'm trying to implement is as you move through a level, enemies should spawn at particular locations. I want to store this information in the level and I don't want to just randomly spawn ene...

How can I spawn a process on Windows and see which files it uses?

I would like to write a C++ function, on Microsoft Windows, that spawns a process and returns, in addition to the process's termination status, a list of all the files the process read or wrote. It should not require any cooperation from the spawned application. For example, if the program spawned is the Visual Studio C++ compiler, the ...

Python: spawn or thread for long running background process?

Hi there, I am planning to make a long running background process with Python but I am still unsure whether to use os.spawnle or thread. I've only read about it therefore I have not much experience with either spawn or thread. Is there any rule of thumb when to use which? Thanks heaps ...

could not able to spawn(ssh) using expect

Hi.. while executing $expect filename.exp user pwd ip I got the error could not execute "ssh -l user ip": no such file or directory The contents of filename.exp are this: #!/opt/sfw/bin/expect -D set OMC_Usr [lindex $argv 0] set OMC_Pwd [lindex $argv 1] set OMC_IP [lindex $argv 2] set cmd "ssh -l $OMC_Usr $OMC_IP" spawn $c...

c/c++, mfc: Not passing open files / handles to a spawned process

In unix I know the routine: between fork() and exec() in the child I close everything except stdin/out/err, so that all the open ports or files are not passed to the program I want to run. But how do I do this in windows? In my case I'm implementing a DLL in C/C++, and I need to close both some files I opened (indirectly via some object...