Perforce Command Reference:   [Index] [Prev] [Next]


File Types

Synopsis

Perforce supports four base file types: text files, compressed binary files, Macintosh resource forks, and symbolic links. File type modifiers are then applied to the base types allowing for support of RCS keyword expansion, file compression, and more.

Perforce attempts to determine the type of the file automatically: when a file is opened with p4 add, Perforce first decides if the file is a regular file or a symbolic link, and then examines the first part of the file to determine whether it is 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.

The base Perforce file types are:

Keyword Description Comments Server
Storage Type
text Text file Treated as text on the client. Line-ending translations are performed automatically on Windows and Macintosh clients. delta
binary Non-text file Accessed as binary files on the client. Stored compressed within the depot. full file,
compressed
symlink Symbolic link UNIX clients access these as symbolic links; non-UNIX clients treat them as (small) text files. delta
resource Macintosh
resource fork
Please see the Macintosh client release notes at <http://www.perforce.com/perforce/doc/macnotes.txt> full file,
compressed

The file type modifiers are:

Modifier Description Comments
+x Execute bit set on client Used for executable files.
+w File is always writable on client
+k RCS keyword expansion Expands the RCS keywords $Id$ and $Header$ to
$Id: //depot/file#revision $ and
$Header: //depot/file#revision $.
+C Server stores the full compressed version of each file revision Default server storage mechanism for binary files.
+D Server stores deltas in RCS format Default server storage mechanism for text files.
+F Server stores full file per revision Useful for long ASCII files that aren't read by users as text, such as PostScript files.
+S Only the head revision is stored on the server Older revisions are overwritten within the depot. Useful for executable or .obj files.

A file's type is normally preserved between revisions, but can be overridden or changed with the -t flag during add, edit, or reopen operations:

The filetype argument is specified as basetype+modifiers. For example, to change file foo's type to executable text with RCS keyword expansion, use p4 edit -t text+kx foo.

Usage Notes



Perforce Command Reference:   [Index] [Prev] [Next]


Copyright 1999 Perforce Software.
Contact us at [email protected]
Last updated: 09/15/99 (Manual version 99.1.cr.6)