| 1 | Due Friday 13th September. | ||||
| Interact with a linked list of named places. | |||||
| 2 | Due Friday 27th September. | ||||
| Make your own shell, part one. | |||||
| 3 | Due Monday 4th November. | ||||
| Make your own shell, part two. | |||||
| 4 | Due Thursday 21st November. | ||||
| Internet chat client and server. | |||||
| 5 | Due Wednesday 11th December, very strict. | ||||
| A grep-like program. | |||||
| Quick introductions, things to come: C programming, Unix using and programming, Shells, commands, and scripts, Processes, Files, beyond merely reading and writing them, Communications between programs, Operations, Utilities. | ||||||
| Starting C. Major differences from C++. Strings. We looked in detail at strlen, strcmp, and strcat. | ||||||
| #include <string.h>, very important strdup; It is possible to re-create useful C++ features in C. A very basic introduction to compiler directives. A first look at macros, their benefits and extreme dangers. cc -D | ||||||
| Where is the source code? Doesn't really matter, it is incomprehensible. Building our own strtok with static variables. Implementing a binary tree in the normal C way. | ||||||
| Everything (i.e. not much) about gets and fgets. All the useful printf formats and some scanf too. Picking up with the tree insert method (done new_node, new_tree, find, and print). creating processes fork, execlp, exit, wait; running a program from a program. Fork bombs and quotas, perror, ^Z suspending a process, a few signals. | ||||||
| Signals: sending, receiving, ignoring. execl, execlp, execv, execvp. WIFEXITED, WIFSIGNALED, WEXITSTATUS, WTERMSIG, the ls -l example again. Unix file functions, open, close, read(file, pointer, number), write, pipe, dup. O_RDONLY, 0_WRONLY, O_RDWR, O_TRUNC, O_CREAT, O_APPEND, O_EXCL, O_NONBLOCK, O_SHLOCK, O_EXLOCK. redirecting output, capturing output. | ||||||
| redirect 0 and 1 with a.out >& name. Both is illogical: (a.out > name2 ) >& name1. Remember /dev/tty sort out capturels.c. The program that caputures ls -l output to find total size of all files. some meteorological data. and the program that shrank it to 34%. | ||||||
| fopen's "r", "w", "a", "r+", "w+", "a+", "wx", "w+x", and adding "b" to the end. What does binary file really mean? Unix and C versions of read, write, and seek. Binary chop search on a file. Sorting a file (but with slow old selection sort). How merge-sort works well for files. | ||||||
| Give them a quick reminder about gdb (done). Experimentally discovering what's in a directory. (you can't run this program except as root) ... ... so: the setuid bit and how to take over any unix system. I-nodes and inode numbers (sometimes file number) unique identifier and root of structure for a file in a disc. readdir/dirent, the permitted way to read directories. stat - function and struct to get metadata of files - size, mode, inode, device, uid, etc. | ||||||
| All the things that stat will tell you, file mode and type not quite the same thing. Pipes and named pipes. Hard links and soft/symbolic links, no hard links to directories because reference counts don't work. Times, time_t, struct timeval, struct tm; time(), localtime(), etc. The example of everything. qsort. | ||||||
| Cooperative processes, comparing two trees: the starting skeleton program. This is the final version of the tree comparing program. Starting on built-in shell commands and script programming. | ||||||
| Lots more on the built-in commands. Our first useful shell script, a very basic backup utility. | ||||||
| A new class you should know about for next Spring. /etc/csh.login, /etc/csh.cshrc, ~/.login, ~/.cshrc setting and getting effective and real uis and gid, the su command. bit stuffing, just a quick exploration today. | ||||||
| Bit stuffing, more prettily. Regular expressions: pico, egrep, an example of regcomp and regexec. | ||||||
| regcomp and regex with multiple matches. Counting the number of 1s in a 32 bit number. | ||||||
| Day Off | 15th | |||||
| Review for test as needed. | ||||||
| First mid-term: a fairly recent sample. Possible topics are: C programming and working with strings. Processes, fork, exec..., wait, pipe, redirecting i/o. File operations, inc. binary, with FILE * f or int fd. Using information about files and directories. | ||||||
| Internet servers and clients, small beginnings: gethostname, reverse lookup. The web client we almost wrote; as always the mistake was trivial and obvious. | ||||||
| The almost web server, the inexplicable problem did indeed just disappear. | ||||||
| continuing from Tuesday: fdopen could be better. <setjmp.h>, jmp_buf, setjmp(), longjmp(). | ||||||
| The web server worked at last (it was really working all along, the unseen part of the url said https instead of http, and that adds a lot of non-human-readbale interactions). Properly processing the HTTP request, and handling security concerns. poll for servicing multiple files/sockets simultaneously (near end of slides for class 19). | ||||||
| Terminal attributes. Threads and mutexes/semaphores. | ||||||
| Really controlling the keyboard: echoing a different character. Pthreads: we've seen the details, now the big picture. Bash, a popular shell. | ||||||
| Using the make utility. | ||||||
| Second mid-term. Possible topics: General C programming but not strings, Signals, Reading and dealing with directories, Things related to the stat function, Shell scripts in tcsh, Regular expressions. sample one, sample two, sample three. | ||||||
| Break | 26th to 29th | |||||
| sed and awk. | ||||||