P4 Fstat Returning Only Files Missing from the Workspace

Is it possible to get an fstat (or any other command) to return a list of all "existing" files (nothing thats been deleted/archived/etc) that dont exist on the users current workspace?

ideally, examples would be in python but standard p4 commands are fine too.

1 Answer

Assuming you mean files that were previously synced but have since been removed from the workspace, the standard command for this is p4 diff -sd:

    diff -- Display diff of client file with depot file

    p4 diff [-d<flags> -f -m max -Od -s<flag> -t] [file[rev] ...]

        ...

        The -s options lists the files that satisfy the following criteria:

                ...

                -sd     Unopened files that are missing on the client.

You can also use p4 reconcile -n -d, p4 status -d, etc.

If you're simply looking for files that haven't been synced, that's just p4 sync -n. Files listed as added are those that are completely missing from the workspace and would hence be added to it by a sync.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Alexander Ross

Alexander Ross

Gaming, Esports & Interactive Media Writer

Alexander Ross has covered the video game industry for a decade, writing deep dives on game design, esports tournaments, VR developments, and gaming culture.

Share this article
Twitter Facebook Pinterest