open process on OSX?

Scott Raney raney at metacard.com
Thu Jul 4 13:39:01 EDT 2002


On Wed, 3 Jul 2002 Yennie at aol.com wrote:

> Can't seem to get open process working on OSX.
> If I do the following:
> 
> open process "/usr/sbin/sendmail"
> answer (the result)
> 
> I get a long (say 30+ seconds) delay, followed by an error.
> In those 30+ seconds I can see sendmail jump to life (in the process viewer 
> app). When it finally gives up waiting and quits, I get my answer dialog.
> 
> Works fine with the equivalent Darwin engine / CGI script.
> 
> Further, if I do this:
> 
> open process "/usr/sbin/sendmail -t"
> answer (the result)
> 
> I immediately get an error- any command line options seem to trigger an 
> instant error with all processes I have tried.
> 
> Am I doing something wrong?

Open process still uses the old Carbon LaunchApplication() call on OS
X, which means you can't use it with a command-line application like
sendmail.  You'll have to either use shell() and redirect the data to
the process from a file, or in this case use a script to send the
mail.  The new dnsServers function enables building true MX record
lookup which means a full replacement for sendmail is possible now.
We have all the scripts to do this already, we just haven't had time
to integrate and test them yet.

As for a longer term solution to this problem, we've not decided how
to handle it.  Since you can't pass command-line arguments to Mac OS
GUI applications, it's not possible to just use the UNIX "open
process" code for the Carbon engine.  We may eventually have to make
"launch" and "open process" work differently (they're essentially
synonyms now), and you'd use one for GUI apps and the other for
command-line apps.
  Regards,
    Scott

> Brian

********************************************************
Scott Raney  raney at metacard.com  http://www.metacard.com
MetaCard: You know, there's an easier way to do that...




More information about the metacard mailing list