Hi all.
I want get the length of a stdin. i.e

Code:
 cat test.txt | myprogram
the program myprogram reads the test.txt and returns the length of the file test.txt

Code:
...
FILE* stdin_stream = fdopen(STDIN_FILENO,"r");
//now i get the length
fseek(stdin_stream,0,SEEK_END);
length = ftell(stdin_stream);
but i have always length = -1....
why?