• 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 16:59:38 -0600
  • Mail-followup-to: Chris Hanson <email@hidden>, email@hidden

On Sun, Oct 27, 2002 at 04:14:44PM -0600, Chris Hanson wrote:
> At 12:53 PM -0600 10/27/02, Nicholas Riley wrote:
> >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.
>
> What I want to know is why a modern operating system would have such
> a limitation in the first place.

I don't know of a Unix-derived OS that doesn't have such a limitation.

> It's not like memory allocation is that hard a problem.

It's a design decision, IMO. The approach of dumping lots of
filenames on the command doesn't scale to thousands of files, because
you have to enumerate them all, potentially filling up megabytes of
memory and holding the whole thing in argv for the duration of the
program's execution. Unix has pipes to facilitate interprocess
communication, and xargs simply functions as a gateway from pipes to
command line arguments, thereby using a lot less memory and resources
than the naive approach of simply making the command line buffer
bounded by memory.

--
=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: Charles Srstka <email@hidden>
References: 
 >Max arguments for NSTask? (From: Charles Srstka <email@hidden>)
 >Re: Max arguments for NSTask? (From: Nicholas Riley <email@hidden>)
 >Re: Max arguments for NSTask? (From: Chris Hanson <email@hidden>)

  • Prev by Date: Re: Splash Screen
  • Next by Date: Dynamic NSScrollView question...
  • Previous by thread: Re: Max arguments for NSTask?
  • Next by thread: Re: Max arguments for NSTask?
  • Index(es):
    • Date
    • Thread