The rmelem command completely deletes one or more elements or symbolic links. In a snapshot view, rmelem also unloads the element from the view.
This command destroys information irretrievably. Use it carefully to avoid compromising your organization's ability to support old releases. The use of this command is not recommended in UCM environments. In that case, and most other cases, use the rmname command instead of rmelem. .
For each element, rmelem does the following:
For each symbolic link, rmelem does the following:
rmelem deletes only the instance of an element type object that is attached to the element. To delete the element type object or to delete the type object and all its instances, use the rmtype command.
Deleting a directory element may cause some other elements (and symbolic links, if the VOB is replicated) to be orphaned; that is, it is no longer cataloged in any version of any directory. rmelem displays a message and moves an orphaned element or symbolic link to the VOB's lost+found directory:
cleartool: Warning: Object "foo.c" no longer referenced.
cleartool: Warning: Moving object to vob lost+found directory
as "foo.c.a0650992e2b911ccb4bc08006906af65".
Each derived object in the deleted directory is also moved to lost+found. (Only dynamic views have derived objects.) The derived object has no data, but you can use it in such commands as lsdo and catcr. View-private objects in the deleted directory are temporarily stranded, but can be transferred to the view's own lost+found directory, as follows:
cmd-context lsprivate –invob /tmp/david_phobos_hw . . . #<Unavailable-VOB-1>/<DIR-c8051152.e2ba11cc.b4c0.08:00:69:06:af:65>/myfile
cmd-context recoverview –dir c8051152.e2ba11cc.b4c0.08:00:69:06:af:65 \ –tag myview Moved file /usr/people/david/myview.vws/.s/lost+found/5ECC880E.00A5.myfile
Use rmelem carefully when deleting elements or symbolic links from the lost+found directory. While the content of lost+found typically consists of unwanted elements and symbolic links, in some circumstances it can contain elements that are cataloged elsewhere in the VOB (that is, not orphaned). For this reason, do not run rmelem recursively in lost+found.
If you need an element in lost+found, catalog it in a versioned directory using mv.
The UNIX system and Linux examples in this section are written for use in csh. If you use another shell, you may need to use different quoting and escaping conventions.
The Windows examples that include wildcards or quoting are written for use in cleartool interactive mode. If you use cleartool single-command mode, you may need to change the wildcards and quoting to make your command interpreter process the command appropriately.
In cleartool single-command mode, cmd-context represents the UNIX system and Linux shells or Windows command interpreter prompt, followed by the cleartool command. In cleartool interactive mode, cmd-context represents the interactive cleartool prompt.
cmd-context rmelem rotate.c
Element "rotate.c" has 1 branches, 2 versions, and is entered
in 6 directory versions.
Remove element, all its branches and versions and modify all directory
versions containing element? [no] yes
Removed element "rotate.c".
cmd-context rmelem release
Element "release" has 1 branches, 9 versions, and is entered
in 35 directory versions.
Remove element, all its branches and versions and modify all directory
versions containing element? [no] yes
cleartool: Warning: Object "hello" no longer referenced.
Object moved to vob lost+found directory as
"hello.5d400002090711cba06a080069061935".
Removed element "release".
cmd-context rmelem \dev\lost+found\text.c
CAUTION! This will destroy the symbolic link, and will remove the
symbolic link from all directory versions that now contain it. Once you
destroy the symbolic link, it will be hard to restore it to its current
state. If you want to preserve the symbolic link, but remove references
to it from future directory versions, use the "rmname" command.
Symbolic link "text.c" is entered in 3 directory versions.
Destroy symbolic link? yes
Removed symbolic link "text.c".