vspacer
 
vspacer
 
Valid XHTML 1.0!
 
Valid CSS 1.0

ClearCase Commands : File Add Move Rename

 

ZDS ClearCase Commands
 
29. To Add a new file to an existing directory.

This is multi part operation as to achieve transparency, cleartool directories are themselves versioned. So ...

#1 First, you have to checkout the directory, because adding a file will change the directory. Enter a checkout comment which can also serve as the check in comment later.

cl co -c "Add file xxx" .

The period indicates that you are checking out a directory.

#2 Make an (empty) file 'element'

cl mkelem -c "file description" file.ext

NOTE! This assumes that the new element has an extension that is known to Cleartool. If not, and you get a gobbledegook message 'Cant pick element type from...' then you must specify an element type eg:

cl mkelem -c "Config stuff" -eltype text_file cb.cfg

The file types are:


text_file : Flat ascii text file
file : Any binary file that you don't mind Cleartool compressing for storage.
compressed_file : Binary file that's already compressed and you want Cleartool to store as-is.

#3 Copy the source code to the new file.

#4 Checkin the file. This will be the first revision.
cl ci -c "comment" file.ext

#5 Check the directory back in.
cl ci .

The default comment you supplied in #1 above sbould be ok.

#6 You should check that you have set up the file with an apppropriate storage type. See: Tip 24 'To find out the file type of a File'.




30. To use symbolic links avoid duplicating an archive file in different directories.

Suppose we have directory A with archived file.ext eg: /../VOBS/.../A/file.ext and we want to have the same file in Directory B.

Rather than duplicate the file, we can place a link in directory /../VOBS/.../B to point to the 'real' archive file in directory A.

To setup the link:

*Change to the B directory
*Checkout the B directory: cl co -c "Link to file A" .
*Change to the A directory
*Enter: cl ln -slink /../vobs/.../A/file.ext /../vobs/.../B
*Change to the B directory and do a ls -al to inspect the links.



31. To move an atria file from one directory to another.

Check out the source directory :
co .

Check out the target directory :
co .

In the source directory type :
mv file.ext /gl/vobs/netman/src/etc/etc/newfile.ext




32. To make a view private copy of a file.

co -unreserved




33. To Cleartool 'rm' an atria archive file.

First enter the ClearCase tool:
cl

Once INSIDE the ClearCase tool
rm filename

This will remove the archive from the view, but it is still accessible and can be viewed or retrieved if you need it again at some later time.

Warning! If you use rm filename outside Cleartool ie at the shell level the file is GONE!




34. To look at a file that has been Cleartool 'rm'd'.

more .@@/main/5/file.ext@@/main/LATEST

Replace '5' with the last version of the directory that contained the file.

Instead of more you can use less - see man less for info.

Download

ClearCase Commands (116KB)

   


Back to top | ZDS Home | This article updated Jnauary 14, 2004.