• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Max arguments for NSTask?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Max arguments for NSTask?


  • Subject: Re: Max arguments for NSTask?
  • From: Nicholas Riley <email@hidden>
  • Date: Sun, 27 Oct 2002 12:53:34 -0600
  • Mail-followup-to: Charles Srstka <email@hidden>, email@hidden

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.

  • Follow-Ups:
    • Re: Max arguments for NSTask?
      • From: Chris Hanson <email@hidden>
References: 
 >Max arguments for NSTask? (From: Charles Srstka <email@hidden>)

  • Prev by Date: Re: [ANN] Cocoa Developer Meeting Place
  • Next by Date: Re: Max arguments for NSTask?
  • Previous by thread: Max arguments for NSTask?
  • Next by thread: Re: Max arguments for NSTask?
  • Index(es):
    • Date
    • Thread