P4 Server file types

P4 Server supports a set of file types that enable it to determine how files are stored by the P4 Server and whether the file can be diffed. When you add a file, P4 Server attempts to determine the type of the file automatically:

  • P4 Server first determines whether the file is a regular file or a symbolic link, and then

  • P4 Server examines the first part of the file to determine whether it’s text or binary.

If any non-text characters are found, the file is assumed to be binary.

Otherwise, the file is assumed to be text.

Files in Unicode environments are detected differently; see P4 Server file type detection and Unicode.

To determine the type of a file under P4 Server control, issue the p4 opened or p4 files command.

To change the P4 Server file type, specify the -t filetype option.

For details about changing file type, see p4 add, p4 edit, and p4 reopen.

P4 Server supports the following file types:

Keyword Description Comments Default storage

binary

Non-text file

Synced as binary files in the workspace. Stored compressed within the depot.

full file, compressed

text

Text file

Synced as text in the workspace. Line-ending translations are performed automatically.

full file, compressed

symlink

Symbolic link

P4 Server applications on UNIX, macOS, recent versions of Windows treat these files as symbolic links. On other platforms, these files appear as (small) text files.

On Windows, you require admin privileges or an appropriate group policy must be set, otherwise, you get text files.

full file, compressed

unicode

Unicode file

Services operating in unicode mode support the unicode file type. These files are translated into the local character set specified by P4CHARSET.

Line-ending translations are performed automatically.

Services not in unicode mode do not support the unicode file type.

For details, see the Internationalization Notes.

full file in UTF-8 format, compressed

utf8

Unicode file

Synced in the client workspace with the UTF-8 BOM (byte order mark).

Whether the service is in unicode mode or not, files are transferred as UTF-8 in the client workspace.

Line-ending translations are performed automatically.

For details, see the Internationalization Notes.

full file in UTF-8 format, compressed without the UTF-8 BOM (byte order mark)

utf16

Unicode file

Whether the service is in unicode mode or not, files are transferred as UTF-8, and translated to UTF-16 (with byte order mark, in the byte order appropriate for the user’s machine) in the client workspace.

Line-ending translations are performed automatically.

For details, see the Internationalization Notes.

full file in UTF-8 format, compressed

apple

 

A legacy format of Apple Inc.

 

resource

 

For resource forks on legacy Apple computers, which are no longer supported by Apple Inc.