linux-c-programming.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* how to find the end of piped data?
@ 2004-09-13 11:36 Richard Sammet
  2004-09-14  6:06 ` Eric Bambach
  2004-09-14  9:03 ` Charlie Gordon
  0 siblings, 2 replies; 5+ messages in thread
From: Richard Sammet @ 2004-09-13 11:36 UTC (permalink / raw)
  To: linux-c-programming

hey list,

i wrote a small tool which gets data over a pipe from other tools (like: 
cat stuff | mytool).

how can i find the end of this data stream?

at the moment im looking for a newline to see if the input is finished, 
but thats not practicable.

this is the rutine for getting the data:

      75 void scanin()
      76 {
      77    int tmpcnt=0;
      78
      79    while(sizeof(tmpkey) && tmpkey[tmpcnt-1] != 10)
      80    {
      81       tmpkey[tmpcnt]=getchar();
      82       tmpcnt++;
      83    }
      84 }

im looking for a flag like EOF but EndOfStream or something like this? ;)

anybody any idea?

e-axe

-- 
=====================================================================
Fraunhofer-Institut für Sichere Informations-Technologie (SIT)

Richard Sammet
Tel.: +49 6151 869 60027
Email: richard.sammet@sit.fraunhofer.de

main(){int
y=0,x;while(y!=6){x=(y==0)?101:((y==1)?45:((y==2)?97:((y==3)?120:((y==4)?101:10))));putchar(x);y++;}}
-
To unsubscribe from this list: send the line "unsubscribe linux-c-programming" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2004-09-14  9:03 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-09-13 11:36 how to find the end of piped data? Richard Sammet
2004-09-14  6:06 ` Eric Bambach
2004-09-14  8:10   ` Charlie Gordon
2004-09-14  8:45   ` Richard Sammet
2004-09-14  9:03 ` Charlie Gordon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).