Well, according to 4.11, "The special filename dot shall refer to the
directory specified by its predecessor.", so dot is a directory by that
definition; and according to the -prune argument for file: "The primary
shall always evaluate as true; it shall cause find not to descend the
current pathname if it is a directory.", so it should not descend dot.
It sounds to me as if we need a special case for "find . -prune" ...
--
Nick
On Wed, 2003-01-15 at 09:29, yyyyy@xxxxxxxxxx wrote:
> Defect report from : Mark Brown , IBM
>
> (Please direct followup comments direct to yyyyyyyyyyyyyy@xxxxxxxxxxxxx)
>
> @ page 450 line 17344 section find -prune objection {IBM-011501}
>
> Problem:
>
> Defect code : 3. Clarification required
>
> When using -prune, is the special filename "." to be treated as a directory
>or as a 'special filename' as per XBD Sec 4.11? On all the UNIX
>implementations I have tried (and Linux as well), I get
>
> $ find /tmp -name '*' -prune
> /tmp
>
> But, if you run this, you get the contents of /tmp:
> $ cd /tmp
> $ find . -name '*' -prune
> ./foo
> ./bar
> ./(and so on)
>
> Where I would have expected:
> $ find . -name '*' -prune
> .
>
> Which is the correct behavior?
>
>
> Action:
>
> Clarify the action of the . and .. filenames either in XBD 4.11 or in the
>-prune section of find.
|