Can I control "things" with I/O Streams? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 4

Can I control "things" with I/O Streams?

I wondered about I/O Streams... The way you can open an I/O stream to control the output of a terminal for example from the stdout stream... So, here's my main question: Can I make drivers by using I/O Streams? For example... can I open an I/O stream (raw bit mode) that connects to my gaming Keyboard, mouse or whatever connected device and manipulate its behaviour or even catch data from it? Like reading a microphone? I know I/O streams represent files... but stdout doesn't look like a file to me.

6th May 2017, 4:16 PM
Jon Lassleben
Jon Lassleben - avatar
3 Answers
+ 4
The I/O streams are intended mostly for files (and for stdin/stdout/stderr/ as special cases). For other devices you typically will use different interfaces. Many languages (especially python) have libraries specifically designed to facilitate this kind of work. If you're interested in digging down into the operating system itself, that's a whole new can of worms, the kind that have senior-level CS classes dedicated to them.
7th May 2017, 5:57 AM
Jim
Jim - avatar
+ 4
I don't have any specific recommendations, unfortunately. As a starting point, I'd see what reference materials your local library has, since that would be just a matter of time invested. Beyond that, it would get into checking reviews & previews of works to see if they fit the bill. The couple C/C++ I've had at times never particularly impressed me.
7th May 2017, 3:26 PM
Jim
Jim - avatar
+ 3
Thank you very much, Jim. I'm still curious about the special and untypical ways of using the write method, can you suggest me any place for reading up on it? Otherwise, I'll wait until I get to that type of course.. or start learning C languages or Rust for OS stuff.
7th May 2017, 9:08 AM
Jon Lassleben
Jon Lassleben - avatar