From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f7344,ac6a44bf769b7c1 X-Google-Attributes: gidf7344,public X-Google-Thread: fc7fa,ac6a44bf769b7c1 X-Google-Attributes: gidfc7fa,public From: "PKM" Subject: Re: Files opened by a process (reposting) Date: 1997/10/30 Message-ID: <01bce539$91fe25e0$ef7710ac@pc0125>#1/1 X-Deja-AN: 285971214 References: <878109665.21049@dejanews.com> Organization: Sonofon Newsgroups: comp.os.vms,comp.sys.vms henry.hoppe@duu.x400.basf-ag.de wrote in article <878109665.21049@dejanews.com>... > Hello! > There are many articles dealing with the question which processes have > opened a file. But I need information just the other way round: which > files are opened by a given process. Is there a way to get this info > from DCL? > TIA Henry Hoppe > > -------------------==== Posted via Deja News ====----------------------- > http://www.dejanews.com/ Search, Read, Post to Usenet > Hi. I use a command procedure like this: $ set noon $ if p1 .nes. "" $ then $ pid=p1 $ goto Check_pid $ endif $ $Enter_pid: $ read/end=Finito/prompt="Enter PID: " sys$command pid $Check_pid: $ prcnam=f$getjpi(pid,"prcnam") $ if "''prcnam'" .eqs. "" then goto Enter_pid $ if prcnam .eqs. "" then goto Enter_pid $ $ open/write ud sys$login:analsys.com $ write ud "$ define/user sys$output sys$login:anal.lis" $ write ud "$ anal/system" $ write ud "set proc """,prcnam,"""" $ write ud "show proc/channel" $ write ud "$ exit" $ close ud $ @sys$login:analsys $ $ of=0 $ open/read/error=Finito ind sys$login:anal.lis $ read/end=Finito ind lin $ read/end=Finito ind lin $ read/end=Finito ind lin $ read/end=Finito ind lin $ read/end=Finito ind lin $ read/end=Finito ind lin $ read/end=Finito ind lin $ read/end=Finito ind lin $ read/end=Finito ind lin $ write sys$output "Open files for ",prcnam $File_loop: $ read/end=Finito ind lin $ fil=f$extract(27,999,lin) $ if f$locate("[",fil) .eq. f$length(fil) then goto File_loop $ of=of+1 $ write sys$output " ",f$element(0," ",fil) $ goto File_loop $ $Finito: $ if f$trnlnm("IND") .nes. "" then close ind $ if of .eq. 0 then - write sys$output " none..." $ delete/nolog sys$login:anal.lis;* $ delete/nolog sys$login:analsys.com;*