Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3

Thread: gzwrite

  1. #1
    Senior Coder gsnedders's Avatar
    Join Date
    Jan 2004
    Posts
    2,340
    Thanks
    1
    Thanked 7 Times in 7 Posts

    gzwrite

    OK, let's say I want to compress all of /thefolder/, and save it at / as backup.gz, how could I go about doing this?

  • #2
    Super Moderator
    Join Date
    May 2002
    Location
    Perth Australia
    Posts
    4,078
    Thanks
    11
    Thanked 98 Times in 96 Posts
    you would first need to make a tarball of the content of that folder then compress that tar file , I think PEAR has a tar class , or perhaps in PECL .

    else exec() , e.g.

    PHP Code:
    <?
    exec
    ('tar -cf thefolder.tar thefolder');
    ?>
    of course if you are exec()ing anyway you can also compress at the same time
    <?
    exec
    ('tar -czf thefolder.tgz thefolder');
    ?>
    resistance is...

    MVC is the current buzz in web application architectures. It comes from event-driven desktop application design and doesn't fit into web application design very well. But luckily nobody really knows what MVC means, so we can call our presentation layer separation mechanism MVC and move on. (Rasmus Lerdorf)

  • #3
    Senior Coder gsnedders's Avatar
    Join Date
    Jan 2004
    Posts
    2,340
    Thanks
    1
    Thanked 7 Times in 7 Posts
    OK, thanks, time to try it out...


  •  

    Posting Permissions

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