Jas wrote:

> Not sure if this is the way it is supposed to work, but I am not sure
> how I can get a directory, like a web directory backed up in one step
> using Archive::Tar.
>
> Code...
>
> #!/usr/bin/perl
>
> use strict;
> use Archive::Tar;
>
> my $bu = Archive::Tar->create_archive("www.tar",0,glob("/path/to/www/*"));
>
> This only grabs files under www/, it doesn't touch the directories.  I
> am still new to perl and have been looking at the Archive::Tar
> documentation on Cpan but it doesn't give an example of how this can be
> accomplished.  Any help is appreciated.
> Jas

It looks to me like the origination of tar files is at most a secondary purpose
of this module.  There are other modules that can assist with the collection of
filenames.

Perl has many magic features to it.  Each was constructed carefully, usually
after the creator had spent a great deal of time coding theinvolved
functionality by hand.  Appreciate the magic that is available, but don't take
it for granted.  You have to do some work here, too.

I  just looked over the documentation for this module, and I see no
creat_archive() method mentioned there.  That does not mean that no such method
exists, it just means that the method is not meant to be used by code other than
class methods.  I could be wrong here--my Perl version is:
perl, v5.8.0
which is probably a few months outdated.  At the time of the release of Version
0.071 of this module, the author had this to say about the modules documented in
the POD:
    At the moment these methods are implemented:

Please read back through the documentation, and use only those methods released
for public use.  When you do so, you may also find that the
File::Find
module will help you in collecting the appropriate filenames.

Joseph

[I thought I might have been hasty in assuming that my version of this module
was current, so I CPANed for the newest release.  This release still does not
document any create_archive, unless my eyesight is getting even worse than  I
thought.]


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to