Home arrow PHP arrow Page 8 - TAR File Management With PHP Archive_Tar

... And Packing Up - PHP

Need to create or manipulate a TAR file through your Web browser? Take a look at the PEAR Archive_Tar class, which exposes a simple, yet extremely powerful, API to perform manipulation of TAR and TGZ archives through a PHP script. Possible applications include a TAR file viewer and a Web-based backup utility.

  1. TAR File Management With PHP Archive_Tar
  2. Back To Basics
  3. Zip Zap Zoom
  4. Adding It All Up
  5. Building An Index
  6. In And Out
  7. X-Ray Vision
  8. ... And Packing Up
By: The Disenchanted Developer, (c) Melonfire
Rating: starstarstarstarstar / 41
July 17, 2003

print this article



And that's about it for this tutorial. Over the last few pages, I took you on a whirlwind tour of the Archive_Tar class, one of the more useful items in PEAR's collection of filesystem tools. I showed you the basics of creating a TAR file, adding files to it, viewing its contents, and extracting it to a specific directory.

I also showed you a couple of more advanced tricks, including compressing the archive with either GZIP or BZIP2 compression and using built-in class methods to alter the directory structure of the files within the archive. Finally, I wrapped things up with two examples of how the Archive_Tar class could be used in real Web applications, by building a simple TAR file viewer and a file backup utility.

In case you'd like to read more about the topics discussed in this article, you should consider bookmarking the following sites:

The official Archive_Tar Web page, at http://pear.php.net/package-info.php?pacid=24

The PEAR Web site, at http://pear.php.net/

The GNU TAR pages, at http://www.gnu.org/software/tar/tar.html

The GZIP pages, at http://www.gzip.org/

The BZIP2 pages, at http://www.digistar.com/bzip2/

Until next time...happy archiving!

Note: Examples are illustrative only, and are not meant for a production environment. Melonfire provides no warranties or support for the source code described in this article. YMMV!

>>> More PHP Articles          >>> More By The Disenchanted Developer, (c) Melonfire

blog comments powered by Disqus
escort Bursa Bursa escort Antalya eskort


- Hackers Compromise PHP Sites to Launch Attac...
- Red Hat, Zend Form OpenShift PaaS Alliance
- PHP IDE News
- BCD, Zend Extend PHP Partnership
- PHP FAQ Highlight
- PHP Creator Didn't Set Out to Create a Langu...
- PHP Trends Revealed in Zend Study
- PHP: Best Methods for Running Scheduled Jobs
- PHP Array Functions: array_change_key_case
- PHP array_combine Function
- PHP array_chunk Function
- PHP Closures as View Helpers: Lazy-Loading F...
- Using PHP Closures as View Helpers
- PHP File and Operating System Program Execut...
- PHP: Effects of Wrapping Code in Class Const...

Developer Shed Affiliates


Dev Shed Tutorial Topics: