line buffering
| From: | Asbjørn Sloth Tønnesen | Date: | Sat, 28 Apr 2007 17:11:18 +0000 |
| Subject: | line buffering | ||
| Groups: | php.internals | ||
| Request: | Send a blank email to internals+get-29091@lists.php.net to get a copy of this message | ||
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi,
I have a program where I need to use tcsetattr to disable line buffering
on stdin, I wan't to create a tcsetattr PHP function, but should I do it
in the core or as a PECL extension?
Example i C, on that I want to implement as a PHP wrapper function.
struct termios oldt, newt;
// get the current attributes
tcgetattr( STDIN_FILENO, &oldt );
// populate the new attributes struct
newt = oldt;
newt.c_lflag &= ~( ICANON | ECHO );
// do stuff
// apply the new attributes
tcsetattr( STDIN_FILENO, TCSANOW, &newt );
// switch back to the old attributes
tcsetattr( STDIN_FILENO, TCSANOW, &oldt );
- --
Best regards
Asbjørn Sloth Tønnesen
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
iD8DBQFGM4A1SViWlxucwuoRAuglAJwKC6b4966XFEMZgRoT0i5aeDf2mACfexyW
P8sglVYqbAER3VbtApJW1N0=
=KEHM
-----END PGP SIGNATURE-----