• 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: command line tool output into a string?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: command line tool output into a string?


  • Subject: Re: command line tool output into a string?
  • From: Ben Dougall <email@hidden>
  • Date: Sat, 24 Apr 2004 11:13:17 +0100

On Saturday, April 24, 2004, at 01:20 am, Bob Ippolito wrote:


On Apr 23, 2004, at 7:56 PM, email@hidden wrote:

i'm using a system() call to call a command line tool. the command
line tool's output is output to standard output. is there anyway to
get that output directly into a string rather than having to direct
it into a file, then open that file? if so, how?

Yeah, don't use system(). You should use a high level abstraction like NSTask, or you need to use popen or the like.

thanks for the reply.

even with NSTask, are you sure you can get the output directly into a string? there's:
- (void)setStandardOutput:(id)file
which takes a file as an argument -- it's that that i'd like to avoid if possible, and have the output go straight into a string bypassing the file bit somehow.

thanks, ben
_______________________________________________
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.


  • Follow-Ups:
    • Re: command line tool output into a string?
      • From: Allan Odgaard <email@hidden>
    • Re: command line tool output into a string?
      • From: Bob Ippolito <email@hidden>
References: 
 >Re: command line tool output into a string? (From: Bob Ippolito <email@hidden>)

  • Prev by Date: NSTask output reading problem
  • Next by Date: Re: command line tool output into a string?
  • Previous by thread: Re: command line tool output into a string?
  • Next by thread: Re: command line tool output into a string?
  • Index(es):
    • Date
    • Thread