PHP Classes
elePHPant
Icontem

File: src/function.gzip_stat.php

Recommend this page to a friend!
  Classes of zinsou A.A.E.Mo´se  >  Big Backup maker  >  src/function.gzip_stat.php  >  Download  
File: src/function.gzip_stat.php
Role: Auxiliary script
Content type: text/plain
Description: auxilliary functions script
Class: Big Backup maker
Create backup of a directory in an archive file
Author: By
Last change:
Date: 1 year ago
Size: 410 bytes
 

Contents

Class file image Download
<?php
function gzip_stat($file)
{
   
$fp = fopen($file, 'rb');
    if (
filesize($file) < 18 || strcmp(fread($fp, 2), "\x1f\x8b")) {
        return
null; // Not GZIP format (See RFC 1952)
   
}
   
$method = fread($fp, 1);
   
$flags = fread($fp, 1);
   
$stat = unpack('Vmtime', fread($fp, 4));
   
fseek($fp, -4, SEEK_END);
   
$stat += unpack('Vsize', fread($fp, 4));
   
fclose($fp);

    return
$stat;
}