How to check if theres something in STDIN

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • eXeonical

    #1

    How to check if theres something in STDIN

    How do i check if there is something new in STDIN?

    I ran into this problem when i was doing some simple command line script
    that takes input from STDIN. And i noticed that feof() always returns
    TRUE with STDIN. Also it seems that if i fread(STDIN) and there is
    nothing in STDIN, it waits forever for input. So i was wondering if
    there is some way to check how much stuff there is in STDIN and then
    read it, because i dont want to wait for the input forever.
Working...