Additionally, when GLOB_NOCHECK is in flags it is not expected to call stat() and return 0 paths if it does not exist. It is on the application to note the increase in count by 1 and compare the result for match to pattern to see if it needs to do a stat() seperately. One of the examples or Application Usage could make this explicit better. I would prefer to see a separate error return value for this case, e.g. GLOB_NOEXIST, as a more efficient means of testing for it, or remove the qualification from GLOB_NOMATCH.
On Thursday, August 1, 2019 Geoff Clare <g...@opengroup.org> wrote: Stephane Chazelas <stephane.chaze...@gmail.com> wrote, on 01 Aug 2019: > > It's also not clear what the interaction between GLOB_MARK and > GLOB_NOCHECK would be. If a pattern expands to itself because it > can't find a match, should it still call stat on it? Not clear? Seems crystal clear to me. GLOB_NOCHECK: "... shall return a list consisting of only pattern". No allowance for a slash to be appended. GLOB_MARK: "Each pathname that is a directory that matches pattern ..." If pattern does not match anything, then it is not "a directory that matches pattern" even if a directory with the same name exists. -- Geoff Clare <g.cl...@opengroup.org> The Open Group, Apex Plaza, Forbury Road, Reading, RG1 1AX, England