• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Piping file through my program gives "Broken Pipe"?!

uCsDNerd

Senior member
Hi guys. I'm running a C program under Unix Solaris. Basically the file that I'm piping through my program is a bunch of numbers in each line, such as:

% 4 43FFD321 10
% 4 42DDE622 5
...
..

Anyhow, my program takes in each line from this file and reads the input through a:
scanf( " %c %d %lx %d ..." , .... );
anyhow, I know my scanf line is correct, the professor gave it to me. And I was told that my while loop:
while( scanf( .... ) != EOF ) { ... } was also correct in detecting the end of the file ( end of input ).

However, through a series of fprintf( stderr, ... ) statements, I've been able to determine that the program does indeed run and execute properly, a couple of hundred lines of from the file, but after a few thousand my program halts and gives me a "Broken Pipe" message.

Anyhow, anybody know what that means and possibly what in my program may be causing this to happen? Thanks.
 
Back
Top