Using Perl, is it possible to query ClearCase for all mounted VOBs and the files/folders the different VOBs contain?

Ampfing's picture
Ampfing asked on September 6, 2011 - 2:19pm | Replies (3).

The code I worked out by now is the following:

use strict;
use Win32::OLE;

print "Instantiating CAL";
my $CCApp = Win32::OLE->new("ClearCase.Application") or
die "Can't create ClearCase application object via call to Win32::OLE->new(): $!";
print "Getting VOBs";
my @CCVob = $CCApp->VOBs();
my $CCVobLength = @CCVob;
print "CCVobLength = $CCVobLength";

With this script I can see that there is one VOB within the CCApp. But I can't figure out how to continue and query the VOB for its name, type or anything useful.

I guess I should add that I'm pretty new to Perl and used to develop software using C, C++ and Java...

There I would cast the element to the appropriate type and then use some interface function to continue...

Thanks in advance for any answer and regards

3 Answers

dengland's picture
dengland replied on October 12, 2011 - 5:06pm.

to find mounted vobs I just use a cleartool lsvob and grep the output for "*" which indicates the VOB is mounted on that system.

Ampfing's picture
Ampfing replied on October 13, 2011 - 5:47am.

Well, that would give me the mounted VOBs.
What I really would like to do is iterate through the files and folders wihtin a view in the VOB without having a path to the files...
But I guess there is no way to query a view for its contents - at least I was unable to figure it out by now - or is there?

dengland's picture
dengland replied on October 13, 2011 - 1:42pm.

Are you just trying to get a list of files that are seen in the view? Are you using Base or UCM?
What are you trying to accomplish?
For a simple file verifiecatioin (for release engineering) I have pulled a recursive ls for a UCM view set to a baseline and then grep'd the list for the file information.

CMCrossroads is a TechWell community.

Through conferences, training, consulting, and online resources, TechWell helps you develop and deliver great software every day.