Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

interrup on windows SIGINT(2)

Status
Not open for further replies.

jr8rdt

IS-IT--Management
Feb 9, 2006
59
US
I have a perl program which actually has 2 parts in it.
First part is running an external program and outputting to a file

system 'capture_data.exe > out.txt';

Second part is ,using the output file, I do some data processing

open(INFILE, "out.txt");
do some data massaging
do some prints
close INFILE;

it works perfectly fine in linux. when I run the program it would first run the data capture. then when I do ctrl-c , it will stop the data capture and do the second part of the program.


but when I run it in windows it would run the first part(data capture) and after I do ctrl-c it won't do the second part . Instead it gets error
"Terminating on signal SIGINT(2)"

can anybody help.




 
Maybe
$SIG{'INT'} = 'IGNORE';
or something??

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[noevil]
Travis - Those Who Say It Cannot Be Done Are Usually Interrupted by Someone Else Doing It; Give the wrong symptoms, get the wrong solutions;
 
look like it working.
Thanks!!
do I have to set it back to normal

$SIG{'INT'} = 'DEFAULT';

at the end of my program? otherwise it will screw-up my windows box ? is this a true statement?

I thought that the interrupt set is just affecting MY script only and nothing else.


 
Yeah it's just local to the script.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[noevil]
Travis - Those Who Say It Cannot Be Done Are Usually Interrupted by Someone Else Doing It; Give the wrong symptoms, get the wrong solutions;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top