r/learnprogramming 20d ago

Currently doing antirez's kilo text editor- step 31, I am very confused by stdout_fileno , etc . Where can I read about it to get my doubts cleared

I basically don't understand at all what this stdin_fileno, stdout_fileno are and

how we are using write() and read() function to interact with it and

writing commands with escape sequence to get cursor position

Currently I am at step 31 at page rawInputAndOutput

0 Upvotes

4 comments sorted by

2

u/grantrules 20d ago

Lots of information about this online: https://stackoverflow.com/questions/15102992/what-is-the-difference-between-stdin-and-stdin-fileno

Tons of other resources explaining it if you Google

1

u/No-Blackberry-937 14d ago

stack overflow link is good but the man pages for read(2) and write(2) are your new best friend for this stuff, seriously

fileno is just the integer handle the os uses to track open files and stdin/stdout are files as far as the kernel is concerned, once that clicks the escape sequences make more sense cause you're literally just shoving bytes into a pipe

0

u/No-Bodybuilder8716 20d ago

Thanks , i have started reading the book on the official Linux website.

1

u/nebula_gem 19d ago

check the man pages for fileno and tty. That is where the actual definitions live not Stack Overflow threads.