1

Clearcase dynamic views can be accessed via M: drive by default.

But if it is mapped in some other drive letter like Y: it will not have View name.

This property is challenging when i am doing scripting . If the user trigger the script from M: drive the path should be constructed with view name.

I am using powershell, If i know how to get the clearcase view name i can construct the path dynamically.

$drive =$Pwd.Drive.Name
$ClearcaseViewName ="How to get current view name from the directory? "

If ( $Pwd.Drive.Name -eq "M" ) {
       $Path = "M:\$ClearcaseViewName\Vobname" 
}
Else { 
       $Path = "$Drive"+":"+"\VobName"
}

Is there any easy way to get clearcase name in powershell? Even cleartool commands can be used in powershell

Samselvaprabu
  • 16,830
  • 32
  • 144
  • 230

1 Answers1

0

A drive letter for a ClearCase view (even a snapshot one actually) represent a Windows subst, used for substituting paths on physical and logical drives as virtual drives.
See for illustration "Getting present working view in Clearcase".

You can check if the following PS commands could help:

The goal is to resolve the Y: drive to its full path M:\viewname\vobname\... from which you can extract the view name.

Even cleartool commands can be used in powershell

In that case, a cleartool pwv -root can help too in order to get the ClearCase view name (if executed anywhere within the Y:\ drive).
That was the approach chosen in the aforementioned "Getting present working view in Clearcase".

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250