in reply to Has foo.tar.bz2 been extracted to $dirrectory?

If you look at Archive::Tar and Compress::Bzip2 you can use both to test for completeness of your two required actions. C::Bzip2 returns undef on error (decompress) and Archive::Tar returns on error as well.

-Waswas
  • Comment on Re: Has foo.tar.bz2 been extracted to $dirrectory?

Replies are listed 'Best First'.
Re: Re: Has foo.tar.bz2 been extracted to $dirrectory?
by Spida (Acolyte) on Nov 02, 2002 at 11:33 UTC
    That would help me while executing my script, but not when the script has run and I don't know if it completed or not.
      Welp, you have really a few options, see if the app writing the file has a lock on it, or check to see if the size of the file is changing for x number of seconds. The C::Bzip2 module failing on decompress will tell you that A: the file is corrupt or B: the file is not all downloaded. You also could try to take the update of the file (Net::FTP etc) into your script so you KNOW when the transfer is complete or if it is a partial. IMHO this is the best route so you don't "spin cycles" checking to see if the file is complete, new or such.

      -Waswas