Path: utzoo!mnetor!uunet!husc6!rutgers!iuvax!wcwang
From: wcwang@iuvax.UUCP
Newsgroups: comp.sys.apollo
Subject: Re: DM question
Message-ID: <5400010@iuvax>
Date: 11 Dec 87 14:56:00 GMT
References: <5400009@iuvax>
Organization: Indiana University CSCI, Bloomington
Lines: 36
Nf-ID: #R:iuvax:5400009:iuvax:5400010:000:1590
Nf-From: iuvax.UUCP!wcwang    Dec 11 09:56:00 1987


From rutgers!umix!apollo!jah Wed Dec  9 18:35:17 1987
Received: by RUTGERS.EDU (5.54/1.14) with UUCP 
	id AA18457; Wed, 9 Dec 87 18:33:54 EST
Received: by umix.cc.umich.edu (5.54/umix-2.0)
	id AA00908; Wed, 9 Dec 87 18:07:55 EST
Received: by apollo.UUCP id AA00067; Wed, 9 Dec 87 13:51:26 est
From: James Hamilton 
Message-Id: <8712091851.AA00067@apollo.UUCP>
Date: Wed, 9 Dec 87 13:35:06 EST
Subject: re: DM question
To: wcwang@iuvax.cs.indiana.edu
Status: R

> Does anyone know how to check inside a C program
> whether a particular file is being displayed/edited on the screen
> by DM or something else?  If so, how to get rid of the window
> containing the file?

There is no good or right way to do it, but here is a suggestion
that may help: first try to ios_$open() the file for write to see
if it is locked.  You get ios_$concurrency_violation if it is.
If it's not, then the DM doesn't have it displayed.  If it
is, then it might or might not be the DM, but if you guess that
it is the dm, you can call pad_$dm_cmd(..., "wc ", ...).  If the
DM has it open this will close it.  If the DM doesn't have it
open, you will get the message "Name does not correspond to a window"
in the DM error window.  Unfortunately there is no way to suppress
this message or have the status returned back through pad_$dm_cmd,
so if you guess wrong... too bad.  When specifying , keep
in mind that the DM may have a different working directory than
your program's.  Also beware of the pitfalls of calling ios_$open
and so on from C.

Jim Hamilton
-------