Programatically determine if a given VOB is mounted in ClearCase

妖精的绣舞 提交于 2019-12-23 19:14:07

问题


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.


回答1:


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)



回答2:


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)



来源:https://stackoverflow.com/questions/1121216/programatically-determine-if-a-given-vob-is-mounted-in-clearcase

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!