wcwang@iuvax.cs.indiana.edu (12/01/87)
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? Thanks in advance! Bill Wang Speech & Hearing Center, Indiana University, Bloomington, IN 47405 UUCP = {ihnp4,seismo,cbosgd}!iuvax!wcwang CSNET = wcwang@indiana ARPA = wcwang@iuvax.cs.indiana.edu Phone = (812) 335-0714
wcwang@iuvax.UUCP (12/11/87)
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 <rutgers!umix!apollo!jah> 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 <pathname>", ...). 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 <pathname>, 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 -------