• 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
setStandardInput Argument
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

setStandardInput Argument


  • Subject: setStandardInput Argument
  • From: Ronnie O <email@hidden>
  • Date: Sat, 17 Sep 2005 11:45:18 -0400

Hello all,
I am trying to pipe standard input out of my app and am noticing I am
getting a different response depending on the type of argument I am
sending.  For instance,
I tried to send the pipe as the argument (as recommended in the docs
so the "read end is closed automatically"):

inputPipe = [NSPipe pipe];
taskInput = [inputPipe fileHandleForWriting];
[taskInput writeData:dataTypeInput];
[task setStandardInput:inputPipe];

Sending the pipe as the argument causes no response from my command
line utility, but it appears as execution occurs.  If I change the
line to:

[task setStandardInput:taskInput];

..now sending the filehandle as the argument, i get an error from my
utility saying "error reading from stdin".  So I can see then that
there is a problem with stdin.

I have the same setup directing input at a perl script that just
echoes back stdin to a textview.  If I use method 1(pipe as argument),
stdin is echoed back just fine.  If I use method 2 (filehandle as
argument), i get the error "uninitialized value in print at /../zz.pl
line 5". Line 5 is my print of the $data, which is set as $data =
<STDIN> in line 4.  Like I said, this all works fine using method 1.

So my question is what is the difference I am seeing with my command
line utility as far as the argument id?  Can anyone see problems
attributable to which argument I am sending?  My more basic question
is what is the difference between sending filehandle or pipe in the
setStandardInput method?  From my perl task, I am pretty sure my setup
of the pipes is functional due to my perl success echo, but its not
jiving with the c command line utility I am using? Any ideas,
recommended readings??  Thanks!
.......
Ronnie
 _______________________________________________
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

  • Prev by Date: Re: Binding using multiple keys
  • Next by Date: NSImageView and CoreData entity creation
  • Previous by thread: Re: Rotating NSViews
  • Next by thread: NSImageView and CoreData entity creation
  • Index(es):
    • Date
    • Thread