PHP 4+ - 5.0.4, Windows XP and Gzip - HELP

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • comp.lang.php

    #1

    PHP 4+ - 5.0.4, Windows XP and Gzip - HELP

    I am simply trying to zip together selected files into a single ZIP
    file. Windows XP doesn't have a native process by which you can do
    this, so I borrowed gzip, downloaded and installed, and upon using it:

    <?
    $msg = exec('gzip -q --suffix .zip '. @join(' ', $fileArray));
    ?>

    All of my files named in $fileArray were horribly mangled!! They all
    were converted individually into files with .zip extension that lost
    all of their original data structures.

    I was told it was "so easy" to use gzip.. so how do I use gzip? No
    tutorial exists that I can find that even explains gzip; the docs are
    absolutely not helpful and man gzip is not going to happen since I'm in
    Windows and not UNIX ("gzip -h" does not help either, I need a clear
    example of how to compress files together into a single .zip file, like
    what WinZip does).

    Help!

    Thanx
    Phil

  • comp.lang.php

    #2
    Re: PHP 4+ - 5.0.4, Windows XP and Gzip - HELP

    Resolved by not using gzip.. using PEAR-based class Archive_Zip
    instead.

    Phil

    Comment

    • R. Rajesh Jeba Anbiah

      #3
      Re: PHP 4+ - 5.0.4, Windows XP and Gzip - HELP

      comp.lang.php wrote:
      <snip>[color=blue]
      > I was told it was "so easy" to use gzip.. so how do I use gzip?[/color]
      <snip>

      Glad that you're sorted out already. Anyway, if I'm right you were
      actually trying to use command line version of gzip.

      If you have zlib enabled (it must be enabled as you could use
      Archive_zip), you can use gzip functions <http://in.php.net/zlib>. As
      the usernotes suggest, possibly the easiest way to create gzipped file
      is using URL wrapper:

      file_put_conten ts('compress.zl ib://hello.txt.gz', 'Hello');

      --
      <?php echo 'Just another PHP saint'; ?>
      Email: rrjanbiah-at-Y!com Blog: http://rajeshanbiah.blogspot.com/

      Comment

      Working...