* section scheduling * reviewing the use of opendir/readdir/etc. * mechanics of recursion for walking a directory opendir -- open a directory; returns a DIR* readdir -- read a single entry from a DIR* similar to using stdio to iterate over a file line by line filep = fopen while str = fgets(filep) iterate over a dir entry by entry dirp = opendir(dname) while direntp = readdir(dirp) use lstat to get stat struct for direntp->d_name store the details from lstat calculate columns widths iterate over children, and print the info iterate over child dirs, and make a recursive * TODO for Brandon: double check on the what the value of total is * approaches for working on the assignment a recommendation: identify an incremental approach that can be tested in small chunks alongs the way v1: support one file v2: just a directory with no child directories v3: now handle child dirs * error checking ls is "best effort" ... after a failure, it just continues on, but then exits with a non-zero exit status for reporting errors from any function that set errno, use one of: fprintf(stderr, "info string: "); perror(infostr); fprintf(stderr, "info string: '%s': %s\n", filename, strerror(errno)); nonstandard, so don't use in portable code fprintf(stderr, "info string: '%s': %m\n", filename);