rmelem

Removes an element or symbolic link from a VOB

APPLICABILITY


Product

Command Type

ClearCase


cleartool subcommand


ClearCase LT


cleartool subcommand


Attache


command


Platform

UNIX


Windows

SYNOPSIS

rmelem [ -f·orce ] [ -c·omment comment | -cfi·le comment-file-pname

|-cq·uery | -cqe·ach | -nc·omment ] pname ...

DESCRIPTION

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. Using it carelessly may compromise your organization's ability to support old releases. In many cases, it is better to use the rmname command.

For each element, rmelem does the following:

For each symbolic link, rmelem does the following:

NOTE: rmelem does not create an event record when you remove a symbolic link.

rmelem deletes an instance of an element type object. To delete the element type object itself or to delete the type object and all its instances, use the rmtype command.

Deleting a Directory Element

Deleting a directory element may cause some other elements (and symbolic links, if the VOB is replicated) to be orphaned: 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".

(See the mkvob reference page for a description of this directory.)

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:

  1. Use lsprivate to locate stranded files and to determine the ClearCase identifier of the deleted directory element:

  2. cmd-context lsprivate -invob /tmp/david_phobos_hw
    .
    .
    .

    #<Unavailable-VOB-1>/<DIR-c8051152.e2ba11cc.b4c0.08:00:69:06:af:65>/myfile

  3. Use recoverview to move all the stranded files for the deleted directory:

  4. 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

Deleting Elements and Symbolic Links from the lost+found Directory

Use rmelem to delete unwanted elements or symbolic links from the lost+found directory . If you need an element in lost+found, catalog it in a versioned directory using mv.

RESTRICTIONS

Identities: You must be the project owner, the project VOB owner, the symbolic link owner, or

If the element you are trying to remove has no versions with attached metadata and you created all branches, you need only be the element owner.

Locks: An error occurs if one or more of these objects are locked: VOB, element type, element, pool (nondirectory elements).

Mastership: (Replicated VOBs) Your current replica must master the element or symbolic link.

Other: You cannot remove an element if any of its versions are checked out. (You do not have to check out the parent directory before removing one of its elements.)

OPTIONS AND ARGUMENTS

CONFIRMATION STEP.  Default: rmelem prompts for confirmation before deleting anything.

-f·orce

(ClearCase and ClearCase LT) Suppresses the confirmation step.
(Attache) Suppresses the confirmation step for deleting anything in the view or VOB. The confirmation for local writable files still pertains.

EVENT RECORDS AND COMMENTS. Default: Creates one or more event records, with commenting controlled by your .clearcase_profile file (default: -nc). See the comments reference page. Comments can be edited with chevent.

-c·omment comment | -cfi·le comment-file-pname |-cq·uery | -cqe·ach | -nc·omment

Overrides the default with the option you specify. See the comments reference page.

SPECIFYING THE ELEMENTS TO BE REMOVED.  Default: None.

pname ...

One or more pathnames, indicating the elements or symbolic links to be deleted. An extended pathname to a particular version or branch of an element references the element itself.

EXAMPLES

The UNIX 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 shell or Windows command interpreter prompt, followed by the cleartool command. In cleartool interactive mode, cmd-context represents the interactive cleartool prompt. In Attache, cmd-context represents the workspace prompt.

NOTE: In the UNIX examples that follow, arguments and output that show multicomponent VOB tags are not applicable to ClearCase LT, which recognizes only single-component VOB tags. In this manual, a multicomponent VOB tag is by convention a two-component VOB tag of the form /vobs/vob-tag-leaf-for example, /vobs/src. A single-component VOB tag consists of a leaf only-for example, /src. In all other respects, the examples are valid for ClearCase LT.

SEE ALSO

mkelem, mkvob, rmbranch, rmname, rmtype, rmver