Re: Max arguments for NSTask?
Re: Max arguments for NSTask?
On Sun, Oct 27, 2002 at 12:37:48PM -0600, Charles Srstka wrote:
>
I'm finding that if I try to launch a process using NSTask with too
>
many arguments, I get this:
>
>
*** NSTask: Task create for path /bin/pax failed: 7, "Argument list too
>
long".
>
>
and my app promptly hangs with the dreaded pinwheel of death. So, my
>
question is, what is the maximum number of arguments that NSTask can
>
take? Is this documented anywhere? Is there a way around it?
This is most likely not a NSTask limitation but a generic command-line
invocation problem. You can use sysctl to retrieve kern.argmax
(CTL_KERN, KERN_ARGMAX in <sys/sysctl.h>). Note that this is a
character limit, not an argument limit; sysctl.h does not make this
very clear.
I mention some workarounds from the command-line context here:
<
http://www.cocoadev.com/index.pl?UsernameAsNSString>
but they should be equally applicable to NSTask.
--
=Nicholas Riley <email@hidden> | <
http://www.uiuc.edu/ph/www/njriley>
Pablo Research Group, Department of Computer Science and
Medical Scholars Program, University of Illinois at Urbana-Champaign
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.