S
Stu
I have the following code in a "C" program.
test_prog.c
main()
{
while ( fgets ( buffer, sizeof(buffer), stdin) != NULL)
{
.....
.....
}
}
I want to run the program like this:
ls | test_prog
Is there anyway I can detect in my program if I am being feed
("PIPPED") data.
If I just run my program like this:
test_prog
it sits and waits. I want to put the smarts in it to see if it is
actually getting data feed to it. If not, than I can take action.
Ant sample "C" code tidbets would be appreciated.
Thanks in advance for all that answer this post!!
test_prog.c
main()
{
while ( fgets ( buffer, sizeof(buffer), stdin) != NULL)
{
.....
.....
}
}
I want to run the program like this:
ls | test_prog
Is there anyway I can detect in my program if I am being feed
("PIPPED") data.
If I just run my program like this:
test_prog
it sits and waits. I want to put the smarts in it to see if it is
actually getting data feed to it. If not, than I can take action.
Ant sample "C" code tidbets would be appreciated.
Thanks in advance for all that answer this post!!