Problems with pipes when running programs.

General questions regarding the usage of CodeLite
codegen
CodeLite Curious
Posts: 4
Joined: Mon Jun 26, 2017 10:58 pm
Genuine User: Yes
IDE Question: C++
Contact:

Problems with pipes when running programs.

Post by codegen »

I was hoping to use codelite for teaching the C language to 1st year engineering students (approximately 750 students). The students will be writing simple command line programs (i.e. standard C) with no graphics or event handling. While the labs themselves have windows machines, they students have a mixture of windows and Macs. For one of the labs, I would like to pipe the output of the student's program to another program that will graph the output of the student's program. On the mac this works fine by using '| progname' as the arguments in the project settings. When in ide debugging mode (i.e. breakpoints) the pipe is not active, which is OK as the students should be looking at the output of their program when debugging anyways.

The problem is with the windows version. The only way that using the pipe in the program arguments works if the use code lite terminal is checked. Otherwise the pipe is ignored. The problem is that if the student program contains an infinite loop, the there is no way to interrupt the program. Cntrl-C does not work, and if you use sig-kill on the output window, all it does is kill the window and leaves the student program running in the background. The only way I've found to kill it is to use power shell to find the process id and kill it. Is there any better way to run the program on windows (other than opening a command shell and changing to the directory to run it) so that the process can be safely interrupted? I'm not a windows programmer (unix, linux, mac and iOS).

Thanks.