Restrictions on filenames and identifiers

Spaces in filenames, pathnames, and identifiers

Use quotation marks to enclose files or directories that contain spaces. For example:

"//Acme/dev/docs/manuals/recommended configuration.doc"

If you specify spaces in names for other Helix Server objects, such as branch names, client names, label names, and so on, the spaces are automatically converted to underscores by the Helix Server.

Length limitations

Names assigned to Helix Server objects such as branches, client workspaces, and so on, cannot exceed 1,024 characters.

Reserved characters

By default, the following reserved characters are not allowed in Helix Server identifiers or names of files managed by Helix Server:

Reserved Character Reason

@

File revision specifier for date, label name, or changelist number

#

File revision numbers

*

Wildcard

...

Wildcard (recursive)

%%1 - %%9

Wildcard (positional)

/

Separator for pathname components

These characters have conflicting and secondary uses. Conflicts include the following:

  • UNIX separates path components with /, but many DOS commands interpret / as a command-line switch.
  • Most UNIX shells interpret # as the beginning of a comment.
  • Both DOS and UNIX shells automatically expand * to match multiple files, and the DOS command line uses % to refer to variables.

To specify these characters in filenames or paths, use the ASCII expression of the character’s hexadecimal value, as shown in the following table:

Character ASCII

@

%40

#

%23

*

%2A

%

%25

Specify the filename literally when you add it; then use the ASCII expansion to refer to it thereafter. For example, to add a file called [email protected], issue the following command:

$ p4 add -f //Acme/dev/docs/manuals/[email protected]

When you submit the changelist, the characters are automatically expanded and appear in the change submission form as follows:

//Acme/dev/docs/manuals/recommended%40configuration.doc

After you submit the changelist with the file’s addition, you must use the ASCII expansion to sync the file to your workspace or to edit it within your workspace. For example:

$ p4 sync //Acme/dev/docs/manuals/recommended%40configuration.doc

The requirement to escape the special characters @, #, *, or % also applies if you attempt to use them in the Root: or AltRoots: fields of your client specification; escape them with %40, %23, %2A, or %25 respectively.

Filenames containing extended (non-ASCII) characters

Non-ASCII characters are allowed in filenames and Helix Server identifiers, but entering them from the command line might require platform-specific solutions. If you are using Helix Server in Unicode mode, all users must have P4CHARSET set properly. For details about setting P4CHARSET, see the Helix Core Command-Line (P4) Reference and the Internationalization Notes.

In international environments, use a common code page or locale setting to ensure that all filenames are displayed consistently across all computers in your organization. To set the code page or locale:

  • Windows: use the Regional Settings applet in the Control Panel
  • UNIX: set the LOCALE environment variable