in reply to Archive::Tar then File::Copy?

By the time tar has finished the files must be there. Are you running tar (to extract the files) at the same time as the script? If you are, it would be difficult to see when the file actually gets there, the only good way I can think of is to give the output of tar xv to the perl script. So I recommend you to run the tar first and do the copying after the tar process has exitted unless it's absolutely neccessarry to do otherwise.

If you are doing the copying after untarring, I can't really think of any reason why the extracted files won't show up (unless the untarring and the copying are done on two different machines with some network file system). In that case, I'd check for some tricky errors, like newlines at the end of filenames (I often fall in this trap).

Update. I didn't really answer your actual question. The short answer is no. It would be possible to wait for a file to appear, but you'd have to wait until the contents of the file are written completely by tar, as surely you don't want to copy a parital file. This is almost impossible to do without doing something with the tar process.

Replies are listed 'Best First'.
Re^2: Archive::Tar then File::Copy?
by Elijah (Hermit) on Mar 15, 2005 at 21:50 UTC
    I am not using the Linux binary tar. I am using the perl module Archive::Tar. Therefore both the untar process and the copy process are both being performed by the script therefore I can not just pipe the output of the tar binary to my perl script.

    I will have to come up with something I guess, it appears no one understands what I am trying to do and I do not know how else to say it.

      To be honest, I'm not entirely convinced that you understand what is going on enough to explain the problem. The reason I say this is that if you're unarchiving via Archive::Tar, by the time that $tar->extract() finishes, all the files are fully present in the output directory. The problem is most likely elsewhere, or the problem is incompletely described.

      A reply falls below the community's threshold of quality. You may see it by logging in.