Objectives - Streams - Files STREAMS Most common named streams: ∙ stdout ∙ stderr ∙ stdin (input from keyboard or | from another program) $ ls _NOTES.txt a.c # That output ↑ was on stdout. $ ls > file_list.txt _NOTES.txt a.c # '> file_list.txt' redirects stdout (but not stderr) to the file file_list.txt. $ ls *.java ls: cannot access '*.java': No such file or directory # That output ↑ was on stderr. $ ls *.java > file_list_java.txt ls: cannot access '*.java': No such file or directory # The error message was not redirected. (You could have used '2> file_list_java.txt.) --------------------------------------- "EVERYTHING* IS JUST BYTES" * on computer, phone, network, screen (maybe elsewhere) -------------------------------------------------- How to view contents of a file. $ xxd -g1 c.txt 00000000: 41 42 43 0a ABC. -------------------------------------------------- Where to find information on parameters to these functions. - Reference sheet - From bash: $ man fopen $ man fputc $ man fclose - From Vim: Put your cursor over the function name and press shift-k (capital K). Press q to exit the man page viewer.