IBM Support

Command line add to Source control of a directory with files in a dynamic view returns Error

Technote (troubleshooting)


Problem(Abstract)

This technote explains why the error, Error: Can't create directory element because "<directory>" already exists, occurs when trying to create a new directory element from the command line in an IBM® Rational® ClearCase® VOB.

Symptom

Attempts to create a new directory element in a VOB from the command line interface (CLI) results in the error:


cleartool> mkelem -eltype directory dir1
cleartool: Error: Can't create directory element because "dir1" already exists.

Cause

A view private directory of this name already exists in the parent directory. The cleartool mkelem -eltype directory command is only used when the directory does not already exist.


Resolving the problem

Here are the methods for adding a new directory element to a VOB from CLI:

  1. cleartool mkdir
  2. cleartool mkelem -eltype directory
  3. cleartool mkelem -mkpath

Note: Specifying –eltype directory is equivalent to using the cleartool mkdir command.

The first 2 commands require that the new directory name not already exist. If the name is already in use, then the above error is reported.

To successfully create a new directory element from command line where the name already exists, use option 3:

Example:

M:\dynamic_view\test>cleartool ls
dir1
l ost+found@@\main\0                       Rule: \main\LATEST

M:\dynamic_view\test>cleartool mkelem -eltype directory dir1
cleartool: Error: Can't create directory element because "dir1" already exists.

M:\dynamic_view\test> cleartool mkelem -mkpath dir1
Creation comments for "dir1":
.
Created directory element "dir1".
Created element "dir1" (type "directory").
Checked out "dir1" from version "\main\0".

M:\dynamic_view\test>cleartool ls
dir1@@\main\CHECKEDOUT from \main\0      Rule: CHECKEDOUT
lost+found@@\main\0                      Rule: \main\LATEST


For more information on the cleartool mkdir or mkelem commands, refer to IBM Rational ClearCase Command Reference, or run cleartool man mkdir or cleartool man mkelem from CLI.

Related information

Unable to move private directory
A Japanese translation is available

Cross reference information
Segment Product Component Platform Version Edition
Software Development Rational ClearCase Cleartool

Document information

More support for: Rational ClearCase
Cleartool

Software version: 7.0, 7.0.1, 7.1, 7.1.1, 7.1.2, 8.0

Operating system(s): AIX, HP-UX, IRIX, Linux, Solaris, Windows

Reference #: 1237733

Modified date: 25 January 2012