NYCPHP Meetup

NYPHP.org

[nycphp-talk] determining empty STDIN | php://stdin (cli)

jon baer jonbaer at jonbaer.net
Mon Sep 22 13:33:42 EDT 2003


normally the small scripts i write either getopt for it's content or read
STDIN along the pipe, but i just tried to throw in a usage() function for
null input and could not determine if STDIN was empty or not it, just hangs
(W32).

ie:
$d = fread(STDIN, 1024);

nothing seems to be able to determine if there is content ... any ideas?
have not tried on debian yet.  thought checking (STDIN) would work but
didn't.

- jon

pgp key: http://www.jonbaer.net/jonbaer.asc
fingerprint: F438 A47E C45E 8B27 F68C 1F9B 41DB DB8B 9A0C AF47




More information about the talk mailing list