Operating System - OpenVMS
1827745 Members
3123 Online
109969 Solutions
New Discussion

Re: Looking For .Com files....

 
Christopher Waddell
Occasional Advisor

Looking For .Com files....

I am looking for all the .com files that exist on each disk.

I know the basic syntax is:

dir dev:[000000...]*.com

But how do I find out what to substitute for the "000000"??

Thanx In Advance,
->C.Waddell
13 REPLIES 13
Bojan Nemec
Honored Contributor

Re: Looking For .Com files....

Christopher,

Wellcome to the VMS forum!

The syntax is:

$ dir dev:[*...]*.com

This will search the whole disk.
I dont know what you means with what to substitute for the "000000".

The [000000] directory is the top directory of the device. Something like / in unix or c:\ in DOS or Windows.

Bojan
Christopher Waddell
Occasional Advisor

Re: Looking For .Com files....

Thanx for the quick response.

The problem is I have like 10 disks on this machine and I would like to either query them all from the same place or just switch to each one an query it.

I apologize for my terminology, I'm a real noob at this.

->C.
Bojan Nemec
Honored Contributor

Re: Looking For .Com files....

Christopher,

You can not do a command like:

$ dir *:[*...]

but you can type:

$ dir disk1:[*...]*.com
$ dir disk2:[*...]*.com

or in one line:

$ dir disk1:[*...]*.com,disk2:[*...]*.com


Bojan
Bojan Nemec
Honored Contributor

Re: Looking For .Com files....

Ok,

There is a command procedure which will search all disks:

$l:
$ dv=f$device("*:","DISK")
$ if dv.eqs."" then exit
$ if f$getdvi(dv,"MNT") then dir 'dv'[*...]*.com
$ goto l

Maybe needs some more controls but in most cases it will work.

Bojan
Christopher Waddell
Occasional Advisor

Re: Looking For .Com files....

Looks like that prog wants to work, but, it claims now I have insufficent privledge.

Thanx for all your help. I need to rattle some cages to get the permissions to do my job.

->C.

Wim Van den Wyngaert
Honored Contributor

Re: Looking For .Com files....

You can define a search list for all disks.
Then all_disk:<000000...>*.com will give you all com files on all disks.

Wim
Wim
Joseph Huber_1
Honored Contributor

Re: Looking For .Com files....

no permissions:
Usually directories and files do not have the WORLD:R protection.
You need to be privileged enough to see all files: READALL or higher (SYSPRV,BYPASS) or be in a system group (UIC group low enough to fall into the SYSTEM: protection, usually <10 , exectly defined by sysgen parameter MAXSYSGROUP).
http://www.mpp.mpg.de/~huber
Jan van den Ende
Honored Contributor

Re: Looking For .Com files....

Christopher,

since you are new to VMS (Welcome!):

The structure of the Sytem Disk can be quite confusing to newbees.

The toplevel contains a (varying) number of SYS* directories.
EACH of those have a SYSCOMMON.DIR
BUT: those are ONLY aliases! (more or less comparable to, but definitely different from, softlinks on *UX.
They are all aliases of VMS$COMMON.DIR

So, in your procedure you will see the same sequence of files a number of times.
They really are ONLY different paths to SAME files, so do NOT try to "clean up" the "superflous" files, DELETing ONE means you delete the ONLY one!

For completeness: not really often, but it DOES occur that that construct is also used for other purposes than just the system structure.

hth

Proost.

Have one on me.

jpe
Don't rust yours pelled jacker to fine doll missed aches.
Karl Rohwedder
Honored Contributor

Re: Looking For .Com files....

Attached is a small DCL routine which uses the DFU utility to quickly scan for spcecific files on all or some disks.
At the begining are some customizations for
the DFU utility.

regards Kalle
Peter Barkas
Regular Advisor

Re: Looking For .Com files....

That command procedure looks familiar!

BTW There are more like this at:

http://dcl.openvms.org/

PHB
Christopher Waddell
Occasional Advisor

Re: Looking For .Com files....

I am overwhelmed!

Thanx to all for you help.

To clairify: I am cataloging only. No deleting is ever planned.

Now this works real well:

$Dir _$1$DKA0:[000000...]*.com

Perfect, as a matter of fact. I get a nice list for the dive I can capture in a file. However, there is one little thing. This gives me all the versions of a file (;*) and I only want the latest.

Is there a way to specify that??

->C.
Bob Carter_3
New Member

Re: Looking For .Com files....

Chris,

Adding a semicolon after the file type will result in displaying just the latest version of the files.

Example:
$Dir _$1$DKA0:[000000...]*.com;

Regards,

BC
Antoniov.
Honored Contributor

Re: Looking For .Com files....

Chris,
welcome in vms forum :-)

If you want to catalog you can retrieve only file name with follow commnad
$ DIR :[000000...]*.COM; /COL=1
you can also redirect output to file
$ DIR :[000000...]*.COM; /COL=1 -/OUT=

Antonio Vigliotti


Antonio Maria Vigliotti