[p4] Size of head version of depot files

Jeff Grills jgrills at drivensnow.org
Tue Oct 31 18:49:52 PST 2006


The -Ol option to fstat will output a fileSize attribute per file which give
you just about what you want.  Wrap that in a small script, like this, and
it should do the trick:

#!/usr/bin/perl
open(P4, "p4 fstat -Ol //depot/...#head |");
my $size = 0;
while (<P4>)
{
	$size += $_ if (s/^\.\.\. fileSize //);
}
close P4;
print $size;

j

-----Original Message-----
From: perforce-user-bounces at perforce.com
[mailto:perforce-user-bounces at perforce.com] On Behalf Of Mark Allender
Sent: Tuesday, October 31, 2006 3:41 PM
To: perforce-user at perforce.com
Subject: [p4] Size of head version of depot files


Is there an easy way (short of a full sync of a depot area) to get the total
size in bytes of all head revisions of files?

I'm basically trying to find out how much space all of the head versions of
files would be without having to do the sync.  Full/fresh syncs can take
several hours for the depot area that I'm trying to get metrics from.

Basically I'd like

sizeof(//my_depot/...#head)

in bytes :-)

Thanks!

--
- Mark Allender
- Studio Technical Director
- Volition, Inc (THQ)
- https://www.volition-inc.com 
_______________________________________________
perforce-user mailing list  -  perforce-user at perforce.com
http://maillist.perforce.com/mailman/listinfo/perforce-user




More information about the perforce-user mailing list