Is there any command in clearcase which I can use to export a paricular version of a file? (i.e. an element). I am doing a find label with a given label (using ct find . -ver lbtype(label) -cview -print
command) and want to export the elements returned by the find label to hard disk.
Asked
Active
Viewed 3,136 times
2

Naveen
- 74,600
- 47
- 176
- 233
-
Did you manage to write the right script for calling `cleartool get` with the right parameters? If yes, a sanitized version of said script could be a valuable addition to this page, as a "complementary" answer. β VonC May 18 '11 at 12:24
-
I was using it from a perl script and did a simple `ct get -to $destfile $lblElt`. β Naveen May 18 '11 at 17:31
1 Answers
3
cleartool get
could work (in a snapshot or dynamic view).
get βto C:\build\foo.c.temp \dev\hello_world\foo.c@@\main\2
You would need a script though, to extract from the %CLEARCASE_PN%
the file name, and then pass to said script %CLEARCASE_XPN%
(both variables are set by the cleartool find command)
That script would be called for each version found through an -exec directive
ct find . -ver lbtype(label) -cview -exec "myscript %CLEARCASE_PN% %CLEARCASE_XPN%"
That way, you could build an export path from the first argument, and use the second argument as the full extended pathname to use in order to "get" the version selected by the find
.

VonC
- 1,262,500
- 529
- 4,410
- 5,250