STDIN on different OSs
I'm creating a php script for command line usage. on linux, i must use:
define('STDIN', fopen('php://stdin', 'r'));
to use: fgetc(STDIN)
In windows, however, i must command out the define line to get it to run.
Is there an easy way to make this compatible with both operating systems?
Is there something i should change w/ my fgetc() command, or can i detect
the server's OS and use the define() command accordingly.
Thanks for any suggestions!
-matt
.
Relevant Pages
- Re: OT: who said on this group "try Linux" a while back?
... took an old 120gig drive and put latest release of Ubuntu on it. ... linux will *never* be anything other than a tech nerd curiosity. ... setting in windows that I couldnt do with a few mouse clicks. ... terminal, paste in this command, job done" doesn't matter which DE you are ... (uk.legal) - Re: Lisp/Unix impedance [a programming challenge]
... >> You can't pipe a command into xterm. ... You can't pipe a Web ... desktop on Red Hat Linux almost 10 years ago. ... developed a working style whih really suited the Windows ... (comp.lang.lisp) - Re: PcLinux
... I never said Windows was more capable, I pointed out that it is just as ... I'm not bashing Linux ... It has been with unix since at least v7 unix. ... And the reason for the short command names ... (rec.crafts.metalworking) - Re: PcLinux
... I never said Windows was more capable, I pointed out that it is just as ... I'm not bashing Linux ... It has been with unix since at least v7 unix. ... This set of command names persists ... (rec.crafts.metalworking) - [PATCH 19-rc2] Fix misc .c/.h comment typos
... Implements an interface for i2c compatible eeproms to run under linux. ... Changed struct initializer syntax to the currently preferred notation ... ** Packet is an actual packet structure to be filled in with the packet ... -** as the command processore doesn't process the command packet in any way. ... (Linux-Kernel) |
|