Introducing P4 VFS

P4 Virtual File Service (P4 VFS) allows you to accelerate your work by reducing the initial time you wait when syncing from the depot to your client workspace Directories on your machine where you work on file revisions that are managed by P4 Server.. You save time, disk space, and network bandwidth because you only download what you need, and only when you need it.

Without P4 VFS, the p4 sync command, which corresponds to Get Latest in P4V, downloads both all the file content and the metadata for all the files included in the request.

Placeholders for file content

With P4VFS, your workspace gets file metadata when Retrieving files from the depot with P4 Visual Client (P4V)Get Latest or the command-line client p4 sync request.

You might only need to work with a small percentage of the files that mapped to the depot in your client workspace configuration.

A large file might contain many megabytes or gigabytes of content, but the metadata associated with that file might only be a few kilobytes.

The following diagram shows the P4 command-line client, P4, sending a request to sync from the P4 Server, P4D. The server provides metadata to an intermediary, P4 VFS, and the client machine's file system (NTFS) gets a small file placeholder instead of the file content, which might be large. This allows Windows File Explorer to show the location of the file placeholder in the directory tree.

When you use P4V, P4, Windows Explorer, or any other client application that can request file content from the operating system to work with a specific file, P4VFS downloads that file’s content from the P4 Server to your client workspace. In this example, when you “open” the specific file you want, the content is downloaded from the P4D Server onto your local computer.

Specify hotfiles that don't create placeholders

Placeholders can make the initial sync operation much faster. However, you might want certain files to be sync'd rather than have placeholders. Hotfiles don't create placeholders. Consider hotfiles for the following situations:

Because the hotfiles are exceptions to altsync, the hotfiles can also benefit from the Delta Transfer feature described at Delta Transfer of large binary files in the P4 Server Administration Documentation.

The hotfiles feature requires a 2024.2 (or later) server and a 2024.2 (or later) client.

Rules for hotfiles

You can set rules for your client workspace that specify which files are hotfiles. To learn more, see p4 hotfiles in P4 CLI Reference.

The P4 VFS graphical user interface also allows you to create rules for hotfiles within a given client workspace.

If you add a rule with the P4 VFS graphical user interface, it works in addition to any rules that are specified with the p4 hotfiles command.

However, if you add a rule with an exclusionary path, which begins with the - character, such as -//depot/elm_proj/..., in the P4 VFS graphical user interface, it overrides any conflicting rules specified with the p4 hotfiles command.

For example, if the altsync agent associated with P4 VFS has the following rule with an exclusionary path:

-//depot/project4/...

that exclusionary path overrides the p4 hotfiles rules for that same path:

HotFiles
//depot/project4/... text <5K
//depot/project4/... binary <1M

Add your hotfile rules

  1. To add hotfile rules for your client workspace, in Windows System Tray, right-click the P4 VFS icon and click Settings.

  2. In the Settings dialog box, enter your rules under Manage Hotfiles Mappings.

  3. To save your hotfile mappings for this client workspace, click Save.

  4. If you want the files that you have sync'd or reverted to remain in your client workspace instead of becoming placeholders, select the Don't free downloaded files on sync/revert checkbox, as shown in the screenshot of step 2. This option can be used without hotfile mappings or combined with hotfile mappings.

Allow a hotfile to become a placeholder

If you have a file that you previously hydrated to be fully present in your workspace but now want to convert to a placeholder, right-click (Windows 10) or Shift+right-click (Windows 11), and click Free space. Any subsequent syncs will represent the file as a placeholder until you hydrate it again by opening it for edit.

Known limitations

  • Currently incompatible with P4 Sync and P4EXP.

  • P4VFS is available solely on Windows because it depends on Windows-specific APIs. However, Optional: Custom development is about the P4ALTSYNC protocol, which is cross-platform.