files opened by a process on VMS

1.7k views Asked by At

I have a DCL script on VMS which calls a perl script. Is there a VMS/DCL command I can use that will tell me every file handle opened by the perl script?

4

There are 4 answers

2
Carrie Cobol On BEST ANSWER

Set default to the disk the app runs from (or you might have to try each disk in succession if it's a really large or distributed app). Then the command is

show device/files/nosystem

If you're on a more recent version of VMS and the lists are too long, you can pipe it with a search by doing this:

pipe show device/files/nosystem | search sys$input (name of perl script)

2
Carrie Cobol On

Jason, I need more clarification for a). Are you saying that you want to run your perl script in a batch file and have the batch file monitor the files being accessed by the perl script? Or something else?

1
Carrie Cobol On

Hmm, not sure about that. Maybe add a linux tag to your post so that some linux people can see this and chime in. I'm not sure why your perl program wouldn't know what files it opened. It's your program, wouldn't it access the files you told it to access? Or if you're computing the filenames somehow (which I've done in cobol, but still know at least which directory to find them in, and what naming scheme they use), you'd still have clues like what I mention. Also, since it's your program, and if you're computing the filenames, coudn't you also make your Perl program output it's own little report of what the files were? Like, just after it computes the filename, have it copy the name string to a separate report file.

0
justintime On

You need to find the documentation for undocumented VMS features :-)

Seriously I think that set watch might do what you want. If you issue

$ set watch file/class=(all,nodump)
$ perl yourperlscript.pl

You will get loads of output that will hopefully include what you want. I havent done it for years, you probably tune the options to fine tune it. See http://www.parsec.com/openvms/undocumented.php?page=13