1

I need a perl script using I can copy a versioned file (using extended path) to a directory . the simple copy command here does not working. here the versioned files

K:\views\jah\hakgs\sr\th\test.java@@\main\branch\view\1
K:\views\jah\hakgs\sr\th\test.java@@\main\branch\view\2
K:\views\jah\hakgs\sr\th\test.java@@\main\branch\view\3

I want these files copy and stored outside the view to a directory.like the first versionned file must store in folder name 1,second file in folder 2,3rd file in 3. Is it possible to do with a perl script.

Please give any suggestion.Many thanks in advance

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
devtech
  • 155
  • 1
  • 1
  • 5

2 Answers2

0

The problem is:

if the simple copy does not work, the script Perl won't either.

I suppose K:\views\jah... refers to a snapshot view.

I would recommend first to create a dynamic view and try the same extended path (I assume hakgs is a VOB):

copy M:\jah_views\hakgs\sr\th\test.java@@\main\branch\view\1 \path\to\your\Directory1

If it works, then you can encapsulate it in a script Perl using my ClearCase Perl Package.

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • Hi VonC, Thanks for your reply.infact I am considering the dynamic views only,I have temporary repository location created and I need to copy the files with version from the dynamic view to the temporary repository.The problem is the simple copy is not working as it contains the extended path.I used Cleatool get command to copy but even I have a list of 1000 files with different version and the rename of the files to the element name after copying.any guidance please – devtech Mar 15 '10 at 08:07
0

The easiest way how to copy files is using dynamic view where you simply specify version numbers:

copy "K:\views\jah\hakgs\sr\th\test.java@@\main\branch\view\1" "1\test.java"
copy "K:\views\jah\hakgs\sr\th\test.java@@\main\branch\view\2" "2\test.java"
copy "K:\views\jah\hakgs\sr\th\test.java@@\main\branch\view\3" "3\test.java"

If you are using snapshot view, you need to use following commands (it work also for dynamic view):

cleartool get -to "1\test.java" "K:\views\jah\hakgs\sr\th\test.java@@\main\branch\view\1"
cleartool get -to "2\test.java" "K:\views\jah\hakgs\sr\th\test.java@@\main\branch\view\2"
cleartool get -to "3\test.java" "K:\views\jah\hakgs\sr\th\test.java@@\main\branch\view\3"
ROJI
  • 131
  • 1
  • 5