CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Win32 Programming Help: Problem with open2 & open3 in WinXP. : Edit Log



julmss
New User

Nov 4, 2009, 2:45 AM


Views: 4444
Problem with open2 & open3 in WinXP.

Hello, i have a problem with open2 and open3. Open work succesfully.

I porting my perl script from Linux to Windows. I realize many test and dont find any problem (executing calc.exe, perl script, etc) but three days ago problem starting with one executable.

The executable is a simulation program. It read a file specifiqued in command line parameter and write output files.

I used open3:
$childpid = open3(*HIS_IN, *HIS_OUT, *HIS_ERR, $cmd, @args);


The program start and freeze quickly. ¿Sleep? ¿Waiting by syscall? i dont know.


Screen capture of the three scenarios:
1) Capture when start and blocks (open2 and open3).
$pid = open2(\*CHLD_OUT, \*CHLD_IN, 'c:\madymo70.exe');
print "EXE\n"; #this dont show
waitpid(-1,WNOHANG);
print "FINAL\n";
(File: block on start.jpg)

2) Capture when start correctly (open)
$pid = open(HANDLE, "|C:/madymo70.exe|");
#PROBLEM: ¡¡¡¡¡¡¡continue when program finnish!!!!!!!!
print "EL PID ES: $pid";
waitpid(-1,0);
print "FIN\n";
(File: ok when used open.jpg)
3) Win32::Process::Create work ok but ¿How could i capture stdout and stderr?.

I need start program in background while perl script continue. Perl script check if program finish and connect to database.

Somebody have an idea why it work don't fine?


(This post was edited by julmss on Nov 4, 2009, 5:54 AM)
Attachments: ok when used open.jpg (61.1 KB)
  block on start.jpg (51.9 KB)


Edit Log:
Post edited by julmss (New User) on Nov 4, 2009, 5:54 AM


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives