FILEINFO

Description

Retrieves detailed information about the items in the workspace.

Usage

cm fileinfo <item_path>[ ...] [--fields=<field_value>[,...]] [[--xml | -x [=<output_file>]] | [--format=<str_format>]] [--symlink] [--encoding=<name>]

Options

Option / ArgumentDescription
--fieldsA string of comma-separated values. This selects which fields will be printed for each item. See Remarks for more information.
--xml | -xPrints the output in XML format to the standard output. It is possible to specify an output file. This option cannot be combined with '--format'.
--formatRetrieves the output message in a specific format. See Remarks for more info. This option cannot be combined with '--xml'. This '--format' option prevails over '--fields' if both are specified.
--symlinkApplies the fileinfo operation to the symlink and not to the target.
--encodingSpecifies the output encoding, i.e.: utf-8. See the MSDN documentation at http://msdn.microsoft.com/en-us/library/system.text.encoding.aspx to get the table of supported encodings and its format, (at the end of the page, in the "Name" column).
item_pathItems to display. Use a whitespace to separate the items. Use double quotes (" ") to specify paths containing spaces.

Help

Remarks

This command prints a detailed list of attributes for each selected item. Each attribute is printed on a new line by default.

The attribute list can be modified to display only the attributes the user needs. This can be achieved using the '--fields=<field_list>' which accepts a string of comma-separated attribute names. This way, only those arguments whose name has been indicated are shown.

Revision head changeset

This option is disabled by default. Please note that retrieving this attribute is significantly slower than the rest of them, so we advise users to group together as many items as possible. This will improve execution times by avoiding many separate 'cm fileinfo' executions. Also, this feature is not currently available for controlled directories.

You can find below the complete list of available attribute names. Names marked with an asterisk ('*') will not be shown by default:

Option / ArgumentDescription
ClientPathThe local path on disk for the item.
RelativePathThe workspace-relative path.
ServerPathThe repository path for the item. (Note: Transformed workspaces are not currently supported for this option).
SizeItem size.
HashItem hash sum.
OwnerThe user the item belongs to.
RevisionHeadChangeset(*) The changeset of the revision loaded in the head changeset of the branch. (Please see note above.)
RevisionChangesetThe changeset of the revision currently loaded in the workspace.
RepSpecThe repository specification for the item. (Use 'cm help objectspec' to learn more about rep specs.)
StatusThe workspace item status: added, checked out, deleted, etc.
TypeRevision type (text, binary, directory, symlink, or unknown).
ChangelistThe changelist the item belongs to (if any).
IsLocked(*) Whether the item is locked by exclusive checkout or not.
LockedBy(*) The user who exclusively checked out the item.
LockedWhere(*) The location where the item was exclusively checked out.
IsUnderXlinkWhether the item is located under an Xlink or not.
UnderXlinkTargetThe target of the Xlink the item is under (if any).
UnderXlinkPathThe item server path in the Xlinked repository (if any).
UnderXlinkWritableWhether the Xlink the item belongs to is writable or not.
UnderXlinkRelativeWhether the Xlink the items belongs to is relative or not.
IsXlinkWhether the item itself is a Xlink or not.
XlinkTargetThe target repository the item points to, if it is a Xlink.
XlinkNameThe Xlink name of the item, if it is actually one.
XlinkWritableWhether the Xlink item is a writable Xlink or not.
XlinkRelativeWhether the Xlink item is a relative Xlink or not.

Output format parameters (--format option)

This command accepts a format string to show the output.

The output parameters of this command are the following

  • {ClientPath}
  • {RelativePath}
  • {ServerPath}
  • {Size}
  • {Hash}
  • {Owner}
  • {RevisionHeadChangeset}
  • {RevisionChangeset}
  • {Status}
  • {Type}
  • {Changelist}
  • {IsLocked}
  • {LockedBy}
  • {LockedWhere}
  • {IsUnderXlink}
  • {UnderXlinkTarget}
  • {UnderXlinkPath}
  • {UnderXlinkWritable}
  • {UnderXlinkRelative}
  • {IsXlink}
  • {XlinkTarget}
  • {XlinkName}
  • {XlinkWritable}
  • {XlinkRelative}
  • {RepSpec}

Please note that '--format' and '--xml' options are mutually exclusive, so they can't be used at the same time.

Examples

cm fileinfo file1.txt file2.txt dir/

cm fileinfo "New Project.csproj" --xml

cm fileinfo assets.art --fields=ServerPath,Size,IsLocked,LockedBy

cm fileinfo proj_specs.docx --fields=ServerPath,RevisionChangeset --xml

cm fileinfo samples.ogg --format="{ServerPath}[{Owner}] -> {Size}"