J
jleslie48
I've written a cgi program in C using the borland 5.5 free compiler,
and it runs just fine on an Apache server.
My only issue is if I issue some system calls the cgi suspends until
the call finishes. for example if in my c program I have a line:
system("notepad");
I can see with the taskmanager that an instance of notepad.exe is
running, but its not on my desktop and the cgi program that made the
system call suspends until I kill the notepad.exe process.
I even tried imbedding the the notepad call in a .bat file as so:
system("mybatfile.bat");
mybatfile.bat:
REM call a routine
notepad t.txt
I get the same result.
If I re-write mybatfile.bat to some routine that completes
automatically, all goes well for example:
mybatfile.bat:
REM a simple canned routine
dir >t.txt
this works fine and sure enough, there is a new file named t.txt
created.
What is the right way to call notepad from a cgi, I imagine one of the
variations of spawn() or exec() will do the trick; I'm hoping some
here will know.
TIA,
Jon
and it runs just fine on an Apache server.
My only issue is if I issue some system calls the cgi suspends until
the call finishes. for example if in my c program I have a line:
system("notepad");
I can see with the taskmanager that an instance of notepad.exe is
running, but its not on my desktop and the cgi program that made the
system call suspends until I kill the notepad.exe process.
I even tried imbedding the the notepad call in a .bat file as so:
system("mybatfile.bat");
mybatfile.bat:
REM call a routine
notepad t.txt
I get the same result.
If I re-write mybatfile.bat to some routine that completes
automatically, all goes well for example:
mybatfile.bat:
REM a simple canned routine
dir >t.txt
this works fine and sure enough, there is a new file named t.txt
created.
What is the right way to call notepad from a cgi, I imagine one of the
variations of spawn() or exec() will do the trick; I'm hoping some
here will know.
TIA,
Jon