• 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: Testing if a NSPipe has available data
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Testing if a NSPipe has available data


  • Subject: Re: Testing if a NSPipe has available data
  • From: Alastair Houghton <email@hidden>
  • Date: Mon, 10 Aug 2009 11:40:14 +0100

On 10 Aug 2009, at 09:29, Frédéric Testuz wrote:

I'm using gnuplot to obtain graph of data. You can set gnuplot to send results in various formats and to stdout
I found the way to call it and get the data with NSTask and NSPipe.


Actually, I get the image as an eps. The whole pack of data come in several packs obtain by the pair of methods -[NSFileHandle readInBackgroundAndNotify] and -[NSFileHandle availableData].

But I have to know when there is no more data to wait for. I have found a solution in :
<http://www.cocoabuilder.com/archive/message/cocoa/2000/11/21/31112> which use ioctl. This solution works, but it is a very low api and the message is a little old now.


I just want to know if there is, today, another solution with a higher api perhaps ?

From the documentation:

  availableData

  Returns the data available through the receiver.

  [snip]

  ... Returns an empty data object if the end of file is reached. ...

So what's wrong with waiting for -[NSFileHandle availableData] to return with zero bytes?

Kind regards,

Alastair.

--
http://alastairs-place.net



_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Testing if a NSPipe has available data
      • From: Frédéric Testuz <email@hidden>
References: 
 >Testing if a NSPipe has available data (From: Frédéric Testuz <email@hidden>)

  • Prev by Date: Implementing key view loop in custom NSView
  • Next by Date: Making an NSOutlineView by Default have 1 Parent and 1 Child.
  • Previous by thread: Testing if a NSPipe has available data
  • Next by thread: Re: Testing if a NSPipe has available data
  • Index(es):
    • Date
    • Thread