• 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: reading input from stdin
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: reading input from stdin


  • Subject: Re: reading input from stdin
  • From: Cameron Hayne <email@hidden>
  • Date: Tue, 11 Nov 2003 23:06:48 -0500

On 10/11/03 11:55 PM, "pmcurry" <email@hidden> wrote:

> NSData* inputData = [[NSFileHandle fileHandleWithStandardInput]
> availableData];
> NSString* inputString = [[NSString alloc] initWithData:inputData
> encoding:NSASCIIStringEncoding];

You need to parse the string, breaking it up into the individual lines by
looking for the embedded '\n' characters. I believe there are some NSString
methods that will help with this.
That will make it work no matter how many lines you read at a time - i.e
whether it is gulped up from an input files or typing in line by line at the
console.

--
Cameron Hayne (email@hidden)
Hayne of Tintagel
_______________________________________________
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.

References: 
 >reading input from stdin (From: pmcurry <email@hidden>)

  • Prev by Date: Re: Updating the main menu
  • Next by Date: Re: No man pages when installing xcode?
  • Previous by thread: reading input from stdin
  • Next by thread: pasteboard access in an ssh session
  • Index(es):
    • Date
    • Thread