
4th August 2007, 10:01
|
|
Moderator
|
|
Join Date: Dec 2005
Location: The Netherlands
Posts: 2,010
Thanks: 254
Thanked 134 Times in 120 Posts
|
|
Quote:
|
Originally Posted by blu3ness
Hello, something I wrote very quickly. Could have bugs, havn't tested yet.
PHP Code:
#!usr/local/bin/php
<?php
$total = 0;
$fin = @fopen("path to file", "r");
if ($fin) {
while (!feof($fin)) {
$buffer = fgets($fin);
if (preg_match('/<segment bytes="(\d+)"/',$buffer,$matched))
$total += $matched['1'];
else
continue;
}
fclose($fin);
print $total;
}
?>
|
Hi blu3ness,
This looks good! I'll give it a try later today.
Thank you
__________________
Never execute code written on a Friday or a Monday.
|