• 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 stealth bug in readDataOfLength!! :(
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSTask stealth bug in readDataOfLength!! :(


  • Subject: Re: NSTask stealth bug in readDataOfLength!! :(
  • From: John Stiles <email@hidden>
  • Date: Wed, 25 Oct 2006 11:14:48 -0700

Many others have used NSTask successfully, so there's a strong possibility that you just weren't using the API correctly.
NSTask supports a lot more functionality than system() so it's not surprising that it isn't as easy to use.



On Oct 25, 2006, at 11:05 AM, Theodore H. Smith wrote:

Nevermind.

I solved the problem.

Lesson learnt? NEVER USE NSTASK! It sucks. I used system() instead :(

I spent about 2 hours trying to figure out the bugs in that bloody NSTask. And spend 30 mins or so converting it to system() which works just fine. I did have to pipe the results into a file, but even the overhead of reading that file back out, is better than dealing with the fact that NSTask sucks. :(

On 25 Oct 2006, at 18:19, Theodore H. Smith wrote:

I'm trying to debug this strange problem with NSTask:

    NSTask* t = [NSTask new];
    [t setLaunchPath:@"/usr/bin/curl"];
    [t setArguments:array];


NSPipe* pope = [NSPipe pipe]; NSFileHandle* fh = [pope fileHandleForReading];

    [t setStandardOutput:pope];
    [t launch];

    NSData* data = [fh readDataToEndOfFile];


Now readDataToEndOfFile seems to call through to readDataOfLength. Upon running, this gives me an "_NSfileHandleRaiseOperatioNException". No idea why.


But if I step through the debugger, it works just fine!!!

So if i try to debug it, the bug goes away. This is why I call it a stealth bug. It's making no sense. Any answers anyone??

Why is the task raising an exception anyhow? Is it because the task hasn't loaded yet or what?

This is driving me crazy! I follow the examples here http:// www.cocoadev.com/index.pl?WrappingUnixApps and it doesn't work!! :(




-- http://elfdata.com/plugin/




-- http://elfdata.com/plugin/



_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40blizzard.com


This email sent to email@hidden

_______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
References: 
 >NSTask stealth bug in readDataOfLength!! :( (From: "Theodore H. Smith" <email@hidden>)
 >Re: NSTask stealth bug in readDataOfLength!! :( (From: "Theodore H. Smith" <email@hidden>)

  • Prev by Date: Re: Re: NSTask stealth bug in readDataOfLength!! :(
  • Next by Date: Re: NSSplitView iTunes Like
  • Previous by thread: Re: Re: NSTask stealth bug in readDataOfLength!! :(
  • Next by thread: Re: NSTask stealth bug in readDataOfLength!! :(
  • Index(es):
    • Date
    • Thread