Checking Out Files
and Directories

Using Clearcase commands, you
can create and delete files and directories. On this page, we
will find out how to use the ClearCase checkout command and its
associated commands to get creation/deletion/edit access to these
entities.
Beginning to work with files, directories, and links. In Configuration
Management, we refer to files and directories as "elements."
So anytime you see a reference here to action on an "element",
the action can refer to either file or directory. (ClearCase
symbolic links are a little different for elements: they are
ClearCase objects, and do not have some of the properties of
elements-- such as version history, for instance.)
- First, check your view and position, before beginning to
work with the elements in a vob:
3% cleartool pwv
Working directory view: wilder_ROCei21028
Set view: wilder_ROCei21028
4% pwd
/vob/fx
5%
- In order to change an element, you must check it out. Directories
are checked out to add or delete elements and ClearCase symbolic
links. Use the ClearCase on-line help, manpage, or manuals to
review the syntax of the checkout command. Here is a sample:
5% cd /vob/fx/src//main
/vob/fx/src//main
6% ls
Makefile main.C
7% cleartool checkout main.C
Checkout comments for "main.C":
Changing error messages.
.
Note that you should make a short but descriptive comment,
and end it by entering "." on a line with no other
characters.
- Now you may edit the file.
- In order to delete or create a new element or create a ClearCase
symbolic link, you must checkout the directory in which the file
or link resides or will be created:
5% cd /vob/fx/src//main
/vob/fx/src//main
6% ls
Makefile main.C
7% cleartool checkout .
Checkout comments for ".":
Deleting FX program main.C and creating links.
.
You use the cleartool rmname to remove files' names from
the directory (the files themselves remain in the VOB, however--it
is dangerous and rarely necessary to actually erase a file's
entire history from the VOB):
cleartool rmname main.C
You use the cleartool mkelem command to create elements:
cleartool mkelem -eltype text_file main.C
You use the cleartool ln command to create symbolic links:
cleartool ln -s /tmp/foo main.C
- You can use the cleartool unco command to undo a checkout.
This will discard all changes. You will be given an opportunity
to preserve a private copy of your changes. In this example,
the current directory has been checked-out and the element main.C
removed. We will un-checkout the directory, and main.C reappears:
5% cd /vob/fx/src//main
/vob/fx/src//main
6% ls
Makefile
7% cleartool unco .
... 6% ls
Makefile main.C
- You can use the cleartool lsco to list all checked-out elements.
This command has several useful switches which you should review
in the documentation.
7% cleartool lsco .

Return to SCM Std Ops page