By default, a name can be removed from a directory only if that directory is checked out and there are no checkouts for that element. rmname appends an appropriate line to the directory's checkout comment.
rmname modifies one or more checked-out directories by removing the names of elements and/or VOB symbolic links (in the manner of the UNIX unlink(2) system call). Old versions of the directories do not change; the names continue to be cataloged in the old versions.
To remove a name from a checked-in directory version, you can use the –nco option. For example, you may want to remove an old symbolic link that points to a file that has been removed.
In a snapshot view, this command implicitly executes an update operation on the affected elements.
Example: Suppose you checked out version 3 of a directory named a.dir. Only your view sees this directory version while it is checked out. The command rmname foo.c deletes the name foo.c from the checked-out version of the directory, but leaves references to foo.c in earlier versions (if any) intact. When you check in the directory, all views can access the new version 4, which does not include foo.c.
Keep the following points in mind:
To restore a directory entry for an element that has been removed with rmname, use the ln command to create a VOB hard link to the element's entry in any previous version of the directory. For example:
cmd-context checkout src | Checkout parent directory |
cmd-context rmname src/msg.c | Oops! |
cmd-context ln src@@/main/LATEST/msg.c src/msg.c | Restore deleted name |
If there are no entries for the element in any previous version of the directory, the element is orphaned; that is, moved it to its VOB's lost+found directory. You can move the element to its proper location with the cleartool mv command. (You cannot use ln to link elements that are in the lost+found directory.)
No special identity is required if the directory is checked out; see the checkout reference page. For –nco, you must have one of the following identities:
(Replicated VOBs only) No mastership restrictions.
You cannot use the –nco option in a replicated VOB.
Note: You cannot use –nco in a replicated VOB.
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.
Note: Examples assume that the current working directory is checked out.
Copyright© 2003 Rational Software. All Rights Reserved.