Apr. 15th, 2010

cryowizard: (Default)
Whilst building my ant scripts for perforce updates, had to figure out if people added new files to the local directory but forgot to add them to the Perforce depot.

Here's how to programmatically find that out, from the current directory down:

On Windows:

dir /s /b /a-D | p4 -x - fstat 1>NUL:

On Unix:

find . -type f | p4 -x - fstat 1>/dev/null

(please note that in both cases it is DASH X space DASH space FSTAT, not DASH X space DASH FSTAT)

The command swallows the proper files in the depot (hence redirection to null) and will spit out only the STDERR stream with the ones that are not in depot, in the format:

<full file path>\file1  - no such file(s).
<full file path>\file2  - no such file(s).

Profile

cryowizard: (Default)
cryowizard

June 2020

S M T W T F S
 123456
78910111213
14 151617181920
21222324252627
282930    

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Aug. 14th, 2025 11:33 pm
Powered by Dreamwidth Studios