1

I'm using the ClearCase Automation Library (CAL) in a tool that helps me keep track of unintegrated changes; now I'd like to extend the tool so I can also make checkins through it.

For this feature, I need to find the local copy of a Snapshot View. While I can ask CC which View is attached to a certain directory, I cannot seem to find a function to look up the local directory for a given View; also it appears as if the most reliable method to find out whether a Snapshot View exists locally is to compare the HostName property against the local computer name.

So: Given the IClearCase interface, how can I find all directories in which Snapshot Views exist?

Simon Richter
  • 28,572
  • 1
  • 42
  • 64

1 Answers1

1

I confirm that you cannot find the root directory of a snapshot view only knowing its view tag: a snapshot view can be loaded in several separate directories if you want.

The only link between your snapshot view and its root directory is the .view.dat hidden file which contains the uid of the view.

Plus, the hostname attached to a view has nothing to do with the fact it is loaded or not on a computer. It is the name of the view server (which can be your own desktop, or can be a centralized server). It is on that server that the view.exe process managing all ClearCase-related operations for that view.

So, with your script (like for instance a perl script), you don't really need CAL at first to find that view: you need first to be able to look the the view.dat file, extract the uid, and then check if it is the same than the view uid (lsview -l -full -pro) you are looking for.

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • So my only choice seems to be to scan a configurable path for directories that do not give an error when passed to the directory -> View resolver... – Simon Richter Oct 27 '11 at 14:38
  • @SimonRichter: rather than trying lots of directories, it is best to try only the one with the hidden file '`view.dat`'. – VonC Oct 27 '11 at 14:46
  • 1
    And that, ladies and gentlemen of SO, was my **5000th answer** (in 37 months), eight months after the [4000th answer](http://stackoverflow.com/questions/4953561). And before that: [3000th answer](http://stackoverflow.com/questions/3074849), [2000th answer](http://stackoverflow.com/questions/2027976) and [1000th answer](http://stackoverflow.com/questions/665252) – VonC Oct 27 '11 at 14:50