Follow-up Comment #1, bug #26281 (project findutils): It appears that find is using gnulib's ftp() implementation in a way that isn't guaranteed to order visits to files and subdirectories in any given order. FTS_D and FTS_DP can be used to consider subdirectores before parent directories, but this does not guarantee anything about the relative ordering of return of files in the parent directory, as compared to sudirectories in that parent.
Here is an illustration of a possible execution of "find dir -depth -name Makefile.am -print". The table has 3 columns. The first is the value of fts_info when fts_read returns. The second is the filename (fts_info->fts_path). The third is PRINT if the -print succeeds there. FTS_D dir FTS_NSOK dir/foo FTS_NSOK dir/Makefile.am PRINT FTS_D dir/m4 FTS_NSOK dir/m4/Makefile.am PRINT FTS_DP dir/m4 FTS_NSOK dir/bar FTS_DP dir So here, find will print ... dir/Makefile.am dir/m4/Makefile.am ... when clearly the user expected the opposite order. The correct approach may well be simply to pass an appropriate comparison function to fts_open, so that files are visited last in -depth traversals. >From my reading of the documentation FTS_NSOK is never returned for directories, which would be a required property in order for this strategy to work. _______________________________________________________ Reply to this item at: <http://savannah.gnu.org/bugs/?26281> _______________________________________________ Message sent via/by Savannah http://savannah.gnu.org/ -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org