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:
- p4 add -t filetype filespec will add the files as the specified type.
- p4 edit -t filetype filespec will open the file for edit. Only when the file is submitted will its type will be changed to that specified when opened for editing.
- p4 reopen -t filetype filespec can be used to change the type of a file already open for add or edit.
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
- The type of an existing file can be determined with p4 opened or p4 files.
- Delta storage (the default mode with text files) is a method whereby only the differences (or deltas) between revisions of files are stored. Full file storage (the default mode with binary files) involves the storage of the entire file. The file's type determines whether full file or delta storage will be used. When delta storage is used, file merges and file compares can be performed. Files that are stored in their full form can neither be merged nor compared. Perforce uses RCS format for delta storage.
- Some of the file types are compressed to gzip format for storage in the depot. The compression occurs during the submission process, and decompression happens while syncing. The process is transparent to the user; client workspace will always contain the file as it was submitted.
- Symbolic links on non-UNIX clients will appear as small text files containing a relative path to the linked file. Editing these files on a non-UNIX client should be done with caution, as submitting them to the depot may result in a symbolic link pointing to a nonexistent file on the UNIX client.
- Versions of Perforce prior to 99.1 used a set of keywords to specify file types. These keywords are still supported, but have been made redundant. The following table lists the old keywords alongside their current base file types and modifiers:
Old Keyword |
Description |
Base Filetype |
Modifiers
|
---|
text |
Text file |
text |
none
|
xtext |
Executable text file |
text |
+x
|
ktext |
Text file with RCS keyword expansion |
text |
+k
|
kxtext |
Executable text file with RCS keyword expansion |
text |
+kx
|
binary |
Non-text file |
binary |
none
|
xbinary |
Executable binary file |
binary |
+x
|
ctext |
Compressed text file |
text |
+C
|
cxtext |
Compressed executable text file |
text |
+Cx
|
symlink |
Symbolic link |
symlink |
none
|
resource |
Macintosh resource fork |
resource |
none
|
ltext |
Long text file |
text |
+F
|
xltext |
Executable long text file |
text |
+Fx
|
ubinary |
Uncompressed binary file |
binary |
+F
|
tempobj |
Temporary object |
binary |
+S
|
tempxobj |
Temporary executable object |
binary |
+Sx
|
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)