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

Bernhard Voelker <[email protected]> Thu, 17 Jul 2025 11:19:43 -0400 (EDT)
Newsgroups gmane.comp.gnu.findutils.bugs
Message-ID <[email protected]>
Update of bug #67330 (group findutils):

                  Status:                    None => Invalid
             Assigned to:                    None => berny

    _______________________________________________________

Follow-up Comment #3:

yes, the find command issued is the problem, because it traverses
both directory 'a' and 'b' ... but in undefined order.
Hence, if it traverses 'a' first, and moves all files to 'b',
and then traverses 'b' and calls the mv(1) command with the
target directory 'b' again, it's clear that this is the same
file.

You may try to reproduce with '... -ls -exec ...' to see what
files get moved, or '-D search'.

To fix it, just traverse directory 'a'.

Hence this is not a bug in find, but rather a misunderstanding
in the use of 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-----

iHUEABYIAB0WIQQk97aszIMMAvLLwm6qLAuaBUf3TgUCaHkUjwAKCRCqLAuaBUf3
Tsd7AP9ttKDRVED+FWCq8mdnpjUeZIyrlmd44rUrRM6VAM5RxQD/b1DVJKjE3Pvz
mFGRSBz69WPeFFIT5n8naGoFbYM91QQ=
=cbUG
-----END PGP SIGNATURE-----