in reply to Re^9: Win32: Setting a layer with binmode causes problem with close() on Windows (PerlIO silently fails to close the file)
in thread Win32: Setting a layer with binmode causes problem with close() on Windows
This scenario can work from (cmd.exe) console (no blocking), but not under whatever environment apache sets up (something like without console )
The problem is apache -- actually most webservers -- in that they do not forward the output from CGI processes until (all copies of) both STDOUT and STDERR handles have been closed. If you close those before launching your async process via system 1, ..., then it will not cause the server to block. You can also close them (immediately) within the async script or process.
With respect to Win32::Process, if you set the iflag parameter to false:
Win32::Process::Create($obj,$appname,$cmdline,$iflags,$cflags,$curdir) Creates a new process. Args: $obj container for process object $appname full path name of executable module $cmdline command line args $iflags flag: inherit calling processes handles or not $cflags flags for creation (see exported vars below) $curdir working dir of new process
That will also prevent the problem.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^11: Win32: Setting a layer with binmode causes problem with close() on Windows (PerlIO silently fails to close the file)
by Anonymous Monk on Jun 17, 2013 at 14:51 UTC | |
by BrowserUk (Patriarch) on Jun 17, 2013 at 15:02 UTC |