Chap 10. I/O Redirection and Pipes
* CLI Communication by I/O and PIPES
* cmd $ Comm A B -> print difference
1) A & !B
2) B & !A
3) A & B
* The ">" operator can be used to treats files as variables of arbitrary size and structure
( cmd > writeFile , cmd < ReadFile )
* Fd - stdin 0 stdout 1 stderr 2 (FIXNUM)
* If we open file -> then we receive "THE LOWEST FD"
* Shell $ CMD > FD
then, if you write stdout in code.c, but then we write FD.
in SHELL process stdout -> FD
* How to Attach stdin to FILE
1) Close and Then
2) open..close..dup..close Method3
3) open..dup2..close
* Execute (by fork) -> in child process fd
* Pipe - one Way channel to communicate with File
pipe(int fdArr[2])
'Archived(CSE) > 시스템 프로그래밍' 카테고리의 다른 글
Chap 14. Threads : Concurrent Functions (0) | 2018.12.03 |
---|---|
Chap 7. Event-Driven Programming (0) | 2018.11.27 |
Team project. 산성비(한컴타자연습) cover 게임 구상 (0) | 2018.11.25 |
Chap 11. Connecting to Processes Near and Far Servers and Sockets (0) | 2018.11.21 |
Chap 9. A Programmable Shell (0) | 2018.11.09 |