June 2017
Intermediate to advanced
532 pages
12h 59m
English
The whole program revolves around using file_size on regular files. If the program sees a directory, it recursively descends down into it and calls file_size on all its entries.
The only thing we did to distinguish if we call file_size directly or if we need the recursion strategy was asking the is_directory predicate. This works well for directories that only contain regular files and directories.
As simple as our example program is, it would crash under the following conditions, because of unhandled exceptions:
Read now
Unlock full access