Paul Nathan
Paul Nathan

Reputation: 40309

Programatically determine if a given VOB is mounted in ClearCase

I am trying to programatically determine if a VOB is mounted in clearcase. Specifically, I want to run a command and parse the output.

However, I can't seem to find this information in cleartool describe.

Upvotes: 3

Views: 3526

Answers (2)

onaclov2000
onaclov2000

Reputation: 5841

I've found if you have a view already running, a simple "if exists" \view\\VOB works. Sometimes (if for example you're trying to use the CAL, things can be a tad slow at times)

I.E.

Perl

if (-d "\\view\onaclov\TESTVOB")
{
    #do something now
}

Batch

if not exists \\view\onaclov\TESTVOB <insert mount command here>

The above will check for a particular folder, if it doesn't exist, you can do a mount vob command.

VB.NET

If System.Io.Directory.Exists("\\view\onaclov\TESTVOB") then
    'Blah
end if

Just some additional insight. (you don't always have to use the Clearcase/Quest tools to do what you need)

Upvotes: 2

VonC
VonC

Reputation: 1324505

cleartool lsvob \theVob

should be enough

If there is a star (*): it is mounted

* \thevob

If there is not: it is not yet mounted.

See command lsvob.

:_

By default, lsvob lists all VOBs registered in the current network region, whether or not they are mounted (active).
The default output line can include up to six fields, as shown in this example:

* /vobs/src /net/host2/usr/vobstore/src_vob public (ucmvob, replicated)

The output fields report:

  • Whether the VOB is mounted (*)
  • The VOB tag
  • The VOB storage directory path name
  • Whether the VOB is public or private (see the mkvob reference page)
  • Whether the VOB is a UCM project VOB (ucmvob)
  • Whether the VOB is replicated (replicated)

Upvotes: 2

Related Questions