mkelem

Creates a file or directory element

APPLICABILITY


Product

Command Type

ClearCase


cleartool subcommand


ClearCase LT


cleartool subcommand


Attache


command


Platform

UNIX


Windows

SYNOPSIS

mkelem [ -elt·ype element-type-name ] [ -nco | -ci [ -pti·me ] ] [ -master ] [ -nwa·rn ]

[ -c·omment comment | -cfi·le comment-file-pname |-cq·uery | -cqe·ach | -nc·omment ]
element-pname ...

DESCRIPTION

The mkelem command creates one or more new elements. A new element can be created in a directory only if that directory is checked out. mkelem appends an appropriate line to the directory's checkout comment.

In Attache, any corresponding local files are uploaded before the command is executed remotely. Wildcards are expanded locally by searching in the workspace, rather than remotely.

mkelem processes each element as follows:

  1. Determines an element type from the specified -eltype option or by performing file-typing

  2. Creates an element object with that element type in the appropriate VOB database

  3. UNIX systems: if you are using the -ci option to convert a view-private file to an element, uses the permissions of that file including set-UID and/or set-GID bits; otherwise, sets the mode of the new element to 444 (for a file element) or 777 (for a directory element), as modified by your current umask(1) setting

  4. Initializes the element's version tree by creating a single branch (named main), and a single, empty version (version 0) on that branch

  5. Does one of the following:

  6. In Attache, if elements are checked out, the corresponding files are downloaded to your workspace if they did not exist locally, or the local files are made writable.

  7. Assigns the element to the same source storage pool, cleartext storage pool, and (for new directory elements) derived object storage pool as its parent directory element

  8. In a snapshot view, updates the newly created element

NOTE: Error messages appear if your config spec lacks a /main/LATEST rule. The mkelem command succeeds in creating version /main/0. However, because your view does not have a rule to select this version, you cannot see or check out the element.

RESTRICTIONS

Identities: No special identity is required.

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

Mastership: (Replicated VOBs) No mastership restrictions.

OPTIONS AND ARGUMENTS

SPECIFYING THE ELEMENT TYPE.  Default: mkelem performs file-typing to select an element type. If file-typing fails, an error occurs. See the cc.magic reference page for details on file-typing.

-elt·ype element-type-name

Specifies the type of element to be created. The element type must be a predefined type, or a user-defined type created with the mkeltype command. The element type must exist in each VOB in which you are creating a new element, or (if element-type-selector is a global type) in the Admin VOB hierarchy associated with each VOB. Specifying -eltype directory is equivalent to using the mkdir command.

CHECKOUT OF THE NEW ELEMENT.  Default: mkelem checks out the new element. If a view-private file already exists at that pathname, it becomes the checked-out version of the element. Otherwise, an empty view-private file is created and becomes the checked-out version. In Attache, if neither the -nco or -ci option is specified, the checked-out files are downloaded if they did not exist locally, or the local files are made writable.

-nco

Suppresses automatic checkout; mkelem creates the new element, along with the main branch and version \main\0, but does not check it out. If element-pname exists, it is moved aside to a .keep file, as explained earlier.
-ci [ -pti·me ]

Creates the new element and version /main/0, performs a checkout, and checks in a new version containing the data in view-private file or DO element-pname, which must exist. In Attache, local files corresponding to successfully checked-in versions are made read-only. You cannot use this option when creating a directory element.
With -ptime, mkelem preserves the modification time of the file being checked in. If you omit this option, the modification time of the new version is set to the checkin time.
UNIX SYSTEMS: On some UNIX platforms, it is important that the modification time be preserved for archive files (libraries) created by ar(1) (and perhaps updated with ranlib(1)). The link editor, ld(1), will complain if the modification time does not match a time recorded in the archive itself. Be sure to use this option, or (more reliably) store archive files as elements of a user-defined type, created with the mkeltype -ptime command. This causes -ptime to be invoked when the element is checked in.

MASTERSHIP OF THE MAIN BRANCH. Default: Assigns mastership of the element's main branch to the VOB replica that masters the main branch type.

-master

Assigns mastership of the main branch of the element to the VOB replica in which you execute the mkelem command. If your config spec includes -mkbranch lines or mkbranch rules that apply to the element, and you do not use the -nco option, mkelem creates these branches and assigns their mastership to the current VOB replica. mkelem also prints a note that these branches are explicitly mastered by the current replica; the output also displays the master replica of each associated branch type.

SUPPRESSING WARNING MESSAGES Default: Warning messages are displayed.

-nwa·rn

Suppresses warning messages.

EVENT RECORDS AND COMMENTS. Default: Creates one or more event records, with commenting controlled by your .clearcase_profile file (default: -cqe). 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.  Default: None.

element-pname ...

The pathnames of one or more elements to be created. If you also specify the -ci option, each element-pname must name an existing view-private object. You cannot create a directory element with the same name as an existing view-private file or directory.

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.

SEE ALSO

cc.magic, checkin, checkout, chpool, config_spec, lstype, mkdir, mkeltype, mkpool, protect, update