Results 1 to 3 of 3

Thread: GZIP extract all files?

  1. #1
    Join Date
    Dec 2007
    Location
    Stranded in Sarasota Florida
    Posts
    75
    Thanks
    7
    Thanked 2 Times in 2 Posts

    Question GZIP extract all files?

    I've been browsing the GZIP functions on php.net and I don't see any mention of extracting files from a gz archive on a web server. What function should I be looking for?

  2. #2
    Join Date
    Dec 2007
    Location
    Stranded in Sarasota Florida
    Posts
    75
    Thanks
    7
    Thanked 2 Times in 2 Posts

    Question

    What am I doing wrong with this...?

    Code:
    $filename = "test.gz";
    $zd = gzopen($filename, "r");
    if (!$zd) {echo 'OPEN: did not work?<br />';}
    else {echo 'OPEN: worked?<br />';}
    
    $contents = gzread($zd, 100000);
    if (!$contents) {echo 'READ: did not work?';}
    else {echo 'READ: worked?';}
    gzclose($zd);

  3. #3
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    gzip only does compression of a single file. Generally multiple files are combined into a single tar archive first. You might find this link useful.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •