🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.amiga.tech
Article #11807

Re: Testing for disk (Lock?)

#11807
From: Matt Dillon
Date: Wed, 15 Mar 1989 07:38
28 lines
1222 bytes
:> you would expect.  The problem is that it prompts for DH0: if it is called 
:> before the disk is mounted (the normal case).
:> 
:>         Is there a way to check for the existence of a device or directory and
:> not have a requestor if the check fails?
:
:Yep. In the process structure there is a field called pr_ConsoleTask. If it
:is set to -1 (I think) this will inhibit DOS requesters appearing for that
:process.
:
:     struct Process *p;
:
:     p = (struct Process *) FindTask (0);
:     p->pr_ConsoleTask = (APTR) -1;
	
	Uh, that's a nice easy way to crash your machine ...  it is actually
proc->pr_WindowPtr .  Essentially, you should do this:

    APTR Save;

    Save = p->pr_WindowPtr;
    p->pr_WindowPtr = (APTR)-1L;

    (do stuff that you don't want reuqesters for here)

    p->pr_WindowPtr = Save;

				-Matt
Technical Details
Message-ID: <8903150738.AA12483@hermes.berkeley.edu>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!HERMES.BERKELEY.EDU!dillon

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!HERMES.BERKELEY.EDU!dillon
From: dillon@HERMES.BERKELEY.EDU (Matt Dillon)
Newsgroups: comp.sys.amiga.tech
Subject: Re: Testing for disk (Lock?)
Message-ID: <8903150738.AA12483@hermes.berkeley.edu>
Date: 15 Mar 89 07:38:53 GMT
Sender: daemon@ucbvax.BERKELEY.EDU
Lines: 28