• 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
talking to shell from cocoa/obj-c
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

talking to shell from cocoa/obj-c


  • Subject: talking to shell from cocoa/obj-c
  • From: Matt Neuburg <email@hidden>
  • Date: Thu, 6 Dec 2001 09:58:10 -0800

From within a Cocoa / Objective-C program, how do I speak to the shell in such a way that the response, which would normally go to STDOUT, comes back to me? As a simple example, how can I say "date" (the Unix command) in such a way as to learn the date?

I see how to do this sort of thing with an NSTask by using a file on disk as an intermediary, but I want the Unix command's STDOUT to pipe directly back to me somehow. I tried to do this with an NSPipe but failed.

Thx - m.
--

matt neuburg, phd = email@hidden, http://www.tidbits.com/matt
pantes gar anthropoi tou eidenai oregontai phusei


  • Follow-Ups:
    • Re: talking to shell from cocoa/obj-c
      • From: "Clark S. Cox III" <email@hidden>
    • Re: talking to shell from cocoa/obj-c
      • From: Enigmarelle Development <email@hidden>
    • Re: talking to shell from cocoa/obj-c
      • From: Brian Luft <email@hidden>
  • Prev by Date: Re: Finder Show Info Comments
  • Next by Date: Re: Yet another stupid question...
  • Previous by thread: Re: The sick power!
  • Next by thread: Re: talking to shell from cocoa/obj-c
  • Index(es):
    • Date
    • Thread