Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: programatic tool interaction



You might be thinking of CFM. If you're building a Mach-O application (which you're doing if you're using Xcode; with CodeWarrior you can choose CFM or Mach-O), there's nothing particularly special about "Carbon" applications.

If you're building a CFM application, though, you'd have to look up function pointers at runtime for the POSIX APIs you want to call and call through the function pointers. It might be better to convert to Mach-O, since then you don't have to do that and you'll have a much easier time building a universal binary for both PowerPC- and Intel- based Macs.

-Eric

On Dec 21, 2005, at 12:53 PM, Kevin Packard wrote:

Thanks for all the replies. Because I want to drive the tool from a Carbon app, I didn't think forking would work.

However, I found this sample code which suggests otherwise (http:// developer.apple.com/samplecode/MiniShell/MiniShell.html). I'll investigate further.

Thanks again, your help is much appreciated.
--
Kevin Packard



On Dec 21, 2005, at 3:32 PM, Brian J. Landsberger wrote:

Kevin,

You may be able to use popen for this, Stevens covers this in sections 14.3 and 14.4 of Advanced Programming in the UNIX Environment (first revision). I suggest reading through Chapter 14 though.

Thanks,

Brian J. Landsberger
email@hidden
Cell: 206.658.5819



On Dec 21, 2005, at 12:08 PM, Kevin Packard wrote:

Please forgive me if this is not the appropriate list, but I've not been unable to google the answer, or find it in Apple's dev pages.

Is there any way to programatically interact with a UNIX tool from a Carbon app? sysctl() gives me a one-shot run, but I'd like to launch a tool, create some sort of a pipe to it, write to its stdin, and read from its stdout.

Can someone please point me to a method to do this (or tell me I'm insane)?

thanks,
--
Kevin Packard

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Unix-porting mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/unix-porting/brian% 40landsberger.com


This email sent to email@hidden



_______________________________________________
Do not post admin requests to the list. They will be ignored.
Unix-porting mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/unix-porting/ejalbert% 40cs.stanford.edu


This email sent to email@hidden

_______________________________________________ Do not post admin requests to the list. They will be ignored. Unix-porting mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/unix-porting/email@hidden

This email sent to email@hidden
References: 
 >programatic tool interaction (From: Kevin Packard <email@hidden>)
 >Re: programatic tool interaction (From: "Brian J. Landsberger" <email@hidden>)
 >Re: programatic tool interaction (From: Kevin Packard <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.