Originally Posted By: CharlesS
The "some official size" is ARG_MAX, which is 256 * 1024 bytes, or 256 KiB. It is well-known, and documented in /usr/include/sys/syslimits.h. If you don't have the developer tools installed, you can also use the sysctl tool to look it up.

And/or getconf(1) too:

$ getconf ARG_MAX
262144



Originally Posted By: CharlesS
The xargs tool cuts off at ARG_MAX. -exec + seems to be cutting off at half that, hence 128 KiB, causing twice as many command lines to be executed. In neither case is the command line length able to exceed ARG_MAX.

The bit that caused me to smile back there was where you said 128 KiB had "already been established" —yet, that was the very first mention of "128" in this thread.


Originally Posted By: CharlesS
By the way, I went through the source code to the find tool with a debugger, found the problem, and I think I've fixed it. As expected, it had nothing to do with the inputs given to the program except to the extent that random chance affected the code paths. The issue was that errno was being checked at the wrong time, thus causing spurious errors to be logged. This is a problem, though, because the code is bailing out as soon as it encounters the false error.

Oh, and it's been in there since Leopard. You probably just haven't noticed it because the conditions weren't just right to cause it.

Here is a build I made of the tool which should (hopefully) solve the issue. A patch has been sent to Apple, so if they accept the patch, then this might be fixed in some future version of OS X.

http://www.charlessoft.com/fixed_find.zip

Outstanding. It seems to work properly. (thanks)
I take no credit for your passionate perseverance. wink