• 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: NSTask & NSPipe to perl script
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSTask & NSPipe to perl script


  • Subject: Re: NSTask & NSPipe to perl script
  • From: Michael Watson <email@hidden>
  • Date: Wed, 31 Jan 2007 13:57:25 -0500

Are you waiting for the NSTask operation to finish before reading from the file handle?

NSTask *pdfTask = [[NSTask alloc] init];
NSString *pdfOutput;

[pdfTask setLaunchPath:@"/your/path/here"];
[pdfTask setStandardOutput:[NSPipe pipe]];

[pdfTask launch];
[pdfTask waitUntilExit]; // wait for the task to finish before continuing!


pdfOutput = [[NSString alloc] initWithData:[[[pdfTask standardOutput] fileHandleForReading] availableData] encoding:NSASCIIStringEncoding];

[pdfTask release];

// do stuff with pdfOutput and release


-- m-s


On 31 Jan, 2007, at 13:39, David Brennan wrote:

Hi

I am trying to send text to a perl script, I want to apply regular
expressions to the text, then I use the result.

I am using a pipe to send the text. I create the pipe, and the file
handle, and it works for small text strings.

When I try to pass the text from a 100 page PDF, it fails. Is there a
limit on the amount of data I send to a script, or am I just doing
something wrong?

Thanks,
Dave.
_______________________________________________

Cocoa-dev mailing list (email@hidden)

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:
40bungie.org


This email sent to email@hidden

_______________________________________________

Cocoa-dev mailing list (email@hidden)

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


References: 
 >NSTask & NSPipe to perl script (From: "David Brennan" <email@hidden>)

  • Prev by Date: NSTask & NSPipe to perl script
  • Next by Date: Re: Initializing Subclass of NSTextContainer
  • Previous by thread: NSTask & NSPipe to perl script
  • Next by thread: Re: NSTask & NSPipe to perl script
  • Index(es):
    • Date
    • Thread