tags:

views:

44

answers:

4

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?

+1  A: 

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)

Carrie Cobol
Thanks! Sorry I can't upvote yet.That's getting me on the right track but not quite solving my problem.(a) I need to execute the script simultaneously with the command that will watch, returning results either during execution or after(b) in trying to use show device/files/nosystem, I seem to be only getting back the perl file itself as a result, not any of the files opened by the perl script (using such things as "open" and "tie")
Jason
I figured out (b). Now all that remains is (a).
Jason
A: 

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?

Carrie Cobol
I think I can leave out the DCL script to avoid confusion.Let's just say that I want to execute a perl script xyz.pl from the command line. Upon the termination of xyz.pl, I would like a report of which files it opened.The command you provided only runs at one particular instant. And it has to be run separately from the perl script. Running that command multiple times won't help either because I could miss a file which was opened and closed between those multiple executions.
Jason
Jason
A: 

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.

Carrie Cobol
I need to be able to do this for an arbitrary perl script without modifying it to report back which files it opened.
Jason
A: 

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

justintime