🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comps.sys.mac.programmer
Article #1

Re: HELP!!! MultiFinder EXPERT NEEDED!!!

#1
From: Eric Slosser
Date: Tue, 05 Dec 1989 23:14
42 lines
2158 bytes
Newsgroups: comp.sys.mac.programmer,comp.sys.mac
Subject: Re: HELP!!! MultiFinder EXPERT NEEDED!!!
Summary: 
Expires: 
References: <328@hermix.UUCP> <9161@hoptoad.uucp>
Sender: 
Reply-To: slosser@fugitive.UUCP (Eric Slosser)
Followup-To: 
Distribution: 
Organization: /etc/organization
Keywords: 

You want one program to know if another is running? 

Why bother asking Multifinder?  Set up a semaphor in the form of
a file.  Have the contents of the file be updated by the program
whose exsistence you wish to confirm.  Update the contents 
appropriately quickly.  The inquirer looks for the file, and
checks the contents.  If the first program crashes, the contents 
won't be current (I suggest the contents reflect the system time).
If the first program exits normally, it should delete the file.

You can do all the tricky stuff you want with walking the DA menu,
deciphering MF internals, patching traps, but you'd only be shooting
yourself in the foot (as acknowledged by those who offered these
approaches)

Please note, if the file is accessible over the network, then 
you could easily (depending on which network, of course) 
check to see if a program is running on another machine.

The other way I'd do it, if the queried program wasn't written
to play with a file in the above way, is to walk the chain of 
open files, looking for one of type APPL, and creator 'whatever'.

Look in IM-4 for the calls.  This way uses approved traps, so is
also less likely to break.

Have fun.

(I don't read news often, so it's better to send (e)mail)
Eric Slosser
Technical Details
Message-ID: <1989Dec5.231412.29979@agate.berkeley.edu>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cs.utexas.edu!usc!apple!agate!fugitive.berkeley.edu!slosser

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cs.utexas.edu!usc!apple!agate!fugitive.berkeley.edu!slosser
From: slosser@fugitive.berkeley.edu (Eric Slosser)
Newsgroups: comps.sys.mac.programmer,comp.sys.mac
Subject: Re: HELP!!! MultiFinder EXPERT NEEDED!!!
Message-ID: <1989Dec5.231412.29979@agate.berkeley.edu>
Date: 5 Dec 89 23:14:12 GMT
Sender: usenet@agate.berkeley.edu (USENET Administrator;;;;ZU44)
Reply-To: slosser@fugitive.berkeley.edu (Eric Slosser)
Distribution: usa
Organization: University of California, Berkeley
Lines: 42