Clarifications and Addenda to Preliminary Specification for Homework #1 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1. FOr more information on how find works, see https://math2001.github.io/article/bashs-find-command/ 2. fiend may use linear search to detect loops; faster search is not required. 3. If -maxdepth is unspecified, there is no limit on depth. 4. fiend may ignore wildcard characters that appear in filenames. 5. An example of where {} needs to be replaced by the full name of the file in the arguments to -exec: % ./fiend . -exec echo {} prefix{}suffix \; 6. The reference to find in Matthew and Stones should be pp. 61-65. 7. The search is always depth-first. The default is preorder (node before descendants), but -depth specifies postorder (node after descendants 8. The EXPRESSION begins after the last filename (if any) and consists of + options (-depth and -maxdepth), which affect the overall traversal (rather than the evaluation of EXPRESSION) and always return true: # -depth specifies postorder traversal rather than the default preorder # -maxdepth N limits the traversal to depth N (N is a sequence of digits); if more than one -maxdepth is specified, then the rightmost takes effect + tests (-name and -newer), which return true or false: # -name RE specifies whether or not the local name matches the regex RE # -newer NAME specifies whether or not the file is newer than file NAME + actions (-exec and -print), which may have side effects and return true or false (-print always returns true): # -exec ... \; executes a shell command with the arguments specified # -print prints the name of the file relative to the root of the tree + operators (-o and -a): # -o is OR # -a is AND 9. fiend detects errors in command-line arguments before the first traversal. 10. A FILENAME on the command line that does not exist does not cause fiend to exit immediately. 11. -exec returns true if the status of the command (i.e., the value returned by system()) is 0 and false otherwise. CS-323-09/06/20