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: How to get scripting to work without NSApplication



On Tuesday, December 11, 2001, at 05:32 , Jason Bobier wrote:

Ah... That's clever. I'll give that a try.

According to the POSIX standard write() is one of the calls that you can make from a signal handler.

I didn't know that, thanks for that tidbit. Although, I have no idea
how POSIX-compliant Darwin is.

I.


Thanx,

Jason

On Monday, December 10, 2001, at 07:52 AM, Ingvar Nedrebo wrote:

Jason,

I had exactly the same issue as you and was told not to use
any Cocoa calls in a signal handler. My solution was to create
an NSPipe, do a readInBackgroundAndNotify on the read end,
and then from the signal handler just do a write(2) directly
on the write-end file descriptor.

This works well, and I later saw on the Darwin developers
mailing list somebody recommending this writing-to-a-pipe
from a signal handler trick, so I guess it is pretty safe.

I.
--
Jason A. Bobier email@hidden
Tech Lead, PGP Macintosh Products http://www.prismatix.com/
Network Associates, Inc. Nothing's constant

PGPKey: <http://keys.pgp.com:11371/pks/lookup?op=get&search=0xF6F83318>
Fingerprint: 7809 7E6E BCCA 903D 4618 9740 EB10 9DF9 F6F8 3318


References: 
 >Re: How to get scripting to work without NSApplication (From: Jason Bobier <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.