PREV INDEX NEXT

Author: Stan Eisenstat
Subject: Re: [Cs323] - in parsing
Date: Thursday, 17 Sep 2020, 08:29:08


    > Message Posted By: Unknown
    >
    > When I run /c/cs323/Hwk1/fiend . - . , the program traverses my current
    > directory once, then prints "stat(-) failed", then traverse the directory
    > again (the same behavior as find). However, according to the spec,
    > shouldn't the lone hyphen cause a parsing error, since the lone hyphen
    > ends the list of FILENAMES and is therefore an invalid expression flag?

No.  As stated in the revised specification:

  If the error is in a command-line argument (e.g., when
  stat() or lstat() fails on the argument to -newer, but
  not when a FILENAME does not exist), it exits
  immediately; otherwise it continues execution (e.g.,
  when opendir() fails it moves to the next file).

--Stan-
PREV INDEX NEXT