[bug #67330] -exec[dir] has odd behavior when there are a lot of files

raf <[email protected]> Wed, 16 Jul 2025 20:33:17 -0400 (EDT)
Newsgroups gmane.comp.gnu.findutils.bugs
Message-ID <[email protected]>
Follow-up Comment #1, bug #67330 (group findutils):

Hi, I would expect this behaviour if scanning the . directory came across "a"
before coming across "b". If that's the case, find would process a first,
moving files to b, and then process b, finding all of the previously moved
files, and try to move them to b as well, but they are already in b, hence the
warning message.

The second command would also process a first, finding nothing, then process
b, and move all of the files there into a, without finding any clash.

The order that file system entries are encountered when doing
opendir/readdir/closedir is best considered to be arbitrary. It probably
depends on when each file system entry was created (but maybe not and it
probably depends on the type of file system). This doesn't look like a bug to
me. It's just a result of the fact that you are changing what's in a directory
tree while processing it.


    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?67330>

_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/
signature.asc (application/pgp-signature, 228 B)
-----BEGIN PGP SIGNATURE-----

iHUEABYIAB0WIQQk97aszIMMAvLLwm6qLAuaBUf3TgUCaHhEzQAKCRCqLAuaBUf3
TscUAP0Sar57lwKKN6W3mNt9Ce8ebFSbMVDoSsXyfwBX9sjxSwD+MJcaMrrh7kcB
7+jFrpAFEEif1/LPvBkHgZOOt8+pfg8=
=wBMH
-----END PGP SIGNATURE-----