Help with EPIPE - broken pipe error ...

Help with EPIPE - broken pipe error ...

Post by Thanh » Thu, 19 Aug 1993 06:36:16



I am trying to filter out a large log file by passing a 'tr' command to
popen and then issue a single fread command to read the whole file.
I got a broken pipe error. What causes it and what is the best way to
handle this 'efficiently' ? ( I tried to use fgets, it works perfectly after
about 20 minutes of reading ... ).

Thanks for any helps,

--
--
Thanh Ma

 
 
 

1. fwrite not returning EPIPE! Broken Pipe uncatched!

Hi all,

I am writing a program that implements the FTP client.
The code is more or less taken from BSD ftp client with some minor
changes. The problem I found is that if the remote hosts runs out of
disk space I am getting a Broken pipe.

The relevant piece of code is:

 printf("hello there\n");

  while (!feof(local_file)) {
    fread(&c,1,1,local_file);
    if (!feof(local_file)) {
      result = fwrite(&c,1,1,data_out);
      if (result != 1)
      {
          printf("catch you!! Broken pipe!!\n");
      }

    }
  }  
  printf("out of there\n");

Well, I get the hello there but not the "out of there" message, so
definitely this is the piece that's causing teh probelm. I looked in
Stevens(Advanced.....) and he suggests the check I am doing write
after the fwrite().  Now, it doesn't seem to work.  In a desperate
attempt I started printing each and every single one of the result
codes, they are all 1, even when it crashes.

The system is an SVR4 communicating to an AIX 3.2 FTP server.

Anybody has any ideas what's going on and how I can catch this damn
EPIPE? :-)

Another thing, ther are no fcntl() codes so the fwrite is not chagned
from its default state.

any pointers to possible solutions are greatly appreciated,
--
   Anibal Jodorcovsky  *  Unix _IS_ user friendly...
    Montreal - Canada  *  It's just selective about who its friends are.

2. Q: "partition magic"

3. EPIPE - Broken Pipe ?

4. Question regarding jumpstart server having two interfaces

5. Socket broken pipe error

6. port forwarding ??

7. Broken Pipes Errors with NES 3.6.1

8. Why can't I login in the GUI with a ordinary account?

9. TCP "Broken pipe" programming error

10. Broken Pipe Error

11. Broken pipe error

12. What does socket error "broken pipe" mean?

13. Broken Pipe Errors on Exit