I wanna write boost::asio app which is reading from stdin with boost::asio::streambuf. Anyway the only function which works on streambuf made from STDIN_FILENO is boost::asio::async_read_until. The other ones throws errors. Is there any possibility to read 100 first character from stdin with boost asio function?
相关问题
- boost::process system leaking file descriptors
- How do I discard user input delivered during sleep
- Derived class offset calculation in boost::seriali
- Boost MPI doesn't free resources when listenin
- boost::multiprecision::uint128_t sizeof is 24
相关文章
- boost split with a single character or just one st
- using stdin in pycharm [duplicate]
- boost:asio IPv4 address and UDP comms
- boost serialization and register_type
- Forwarding a shared_ptr without class declaration
- init boost::optional of non-copyable object
- What is the equivalent of boost::make_transform_it
- how to work with “process.stdin.on”?
In principle this just works
When used as
will just output
100
as expected (and echo the input). We can even use live terminal input:When the input is shorter than 100 bytes, you get the
ec.message()
"End of file" printed too.What does not work on Linux is:
you receive:
This is because regular files are not supported for async operations: Strange exception throw - assign: Operation not permitted