Re: How to get scripting to work without NSApplication
Re: How to get scripting to work without NSApplication
- Subject: Re: How to get scripting to work without NSApplication
- From: Jason Bobier <email@hidden>
- Date: Mon, 10 Dec 2001 21:32:14 -0800
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.
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