Creates a file or directory element
Product | Command Type |
---|---|
ClearCase | cleartool subcommand |
ClearCase LT | cleartool subcommand |
Attache | command |
Platform |
---|
UNIX |
Windows |
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:
Determines an element type from the specified -eltype option or by performing file-typing
Creates an element object with that element type in the appropriate VOB database
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
Initializes the element's version tree by creating a single branch (named
main), and a single, empty version (version 0) on that branch
Does one of the following:
By default, checks out the element to your view.
NOTE: At this point, other views see an empty file when they look at the element.
With the -nco option, does nothing.
With the -ci option, creates version 1 by copying a view-private file or an uploaded view-private file.
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.
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
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.
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.
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.
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.
MASTERSHIP OF THE MAIN BRANCH. Default: Assigns mastership of the element's main branch to the VOB replica that masters the main branch type.
SUPPRESSING WARNING MESSAGES Default: Warning messages are displayed.
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.
SPECIFYING THE ELEMENTS. Default: None.
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.
Create a file element named rotate.c of type compressed_text_file, and check out the initial version (version 0).
cmd-context mkelem -nc -eltype compressed_text_file rotate.c
Created element "rotate.c" (type "compressed_text_file").
Checked out "rotate.c" from version "/main/0".
Create three file elements, cm_add.c, cm_fill.c, and msg.c, allowing the file-typing mechanism to determine the element types. Do not check out the initial versions.
cmd-context mkelem -nc -nco cm_add.c cm_fill.c msg.c
Created element "cm_add.c" (type "text_file").
Created element "cm_fill.c" (type "text_file").
Created element "msg.c" (type "text_file").
Convert a view-private file named test_cmd.c, to an element, and check in the initial version.
cmd-context mkelem -nc -ci test_cmd.c
Created element "test_cmd.c" (type "text_file").
Checked in "test_cmd.c" version "\main\1".
Create two directory elements and check out the initial version of each.
cmd-context mkelem -nc -eltype directory libs include
Created element "libs" (type "directory").
Checked out "libs" from version "/main/0".
Created element "include" (type "directory").
Checked out "include" from version "/main/0".
Create an element type named lib for library files, with the predefined binary_delta_file as its supertype. Then, change to the libs directory, check it out, and create two elements of type lib without checking them out.
cmd-context mkeltype -nc -supertype binary_delta_file lib
Created element type "lib".
cmd-context cd libs
cmd-context co -nc .
Checked out "." from version "\main\1".
cmd-context mkelem -nc -nco -eltype lib libntx.lib libpvt.lib
Created element "libntx.lib" (type "lib").
Created element "libpvt.lib" (type "lib").
cc.magic, checkin, checkout, chpool, config_spec, lstype, mkdir, mkeltype, mkpool, protect, update
Feedback on the documentation in this site? We welcome any comments!
Copyright © 2001 by Rational Software Corporation. All rights reserved. |