Usenet comp.sys.vms (1990-2004)
 help / color / mirror / Atom feed
From: "PKM" <PKM@DMT.Sonofon.DK>
Subject: Re: Files opened by a process (reposting)
Date: 1997/10/30	[thread overview]
Message-ID: <01bce539$91fe25e0$ef7710ac@pc0125> (raw)
In-Reply-To: 878109665.21049@dejanews.com




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;*



      parent reply	other threads:[~1997-10-30  5:00 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-10-29  5:00 Files opened by a process (reposting) henry.hoppe
1997-10-29  5:00 ` Aaron Leonard
1997-10-29  5:00 ` Ian Miller
1997-10-29  5:00 ` Arlen Williams
1997-10-30  5:00 ` PKM [this message]
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox