I had a similar case recently where a user ran CCleaner on the temp folder while the application was open. It deleted everything in the cache folder that was not file locked, so the cache folder still exists, along with several of the component files.

A bit of testing showed the .pm and other perl files are re-extracted the next time the PAR is run, but none of the files packed using -a (an icon file and a glade file in my case).

I ended up adding code to the script to manually check for file existence and, if needed, unpacking from the PAR. It's not a solution that will scale well, but I only have two such files. Example code is below, but PAR::par_handle is probably simpler now I look at the docs again.

For the more general case, is there a simple means to trigger the re-extraction of all files packed using -a?

Regards,
Shawn.



###
require Archive::Zip;
my $icon = Path::Class::file ($ENV{PAR_TEMP}, 'inc', 'Biodiverse_icon.ico');
my $icon_str = $icon->stringify;

my $folder = $icon->dir;
my $fname  = $icon->basename;
my $zip = Archive::Zip->new($ENV{PAR_PROGNAME})
  or die "Unable to open $ENV{PAR_PROGNAME}";

my $success = $zip->extractMember ( $fname, $icon_str );



On 16/12/2014 21:06, Kime Philip wrote:
Yes, that’s what I though, just scheduled /tmp cleanup etc. but in fact it 
seems to happen more often on non-Unix …
Certainly some cases were due to users Ctrl-Cing a first .exe run because they 
thought it was taking too long (normal for it to take longer on first run of a 
new version of course, due to unpacking) and then the cache building was 
incomplete. However, most reports are, they say, “suddenly” it no longer works 
and complains about missing files. I can’t really explain it. Deleting the 
cache and running again always fixes it.

PK


On 16 Dec 2014, at 11:02 am, Roderich Schupp <roderich.sch...@googlemail.com> 
wrote:

On Mon, Dec 15, 2014 at 9:15 PM, Kime Philip <philk...@kime.org.uk> wrote:
...regularly we get an error report from users that after a while using the 
tool, a particular file disappears from the cache and the cache has to be 
deleted and the binary unpacked again. I have never worked out why this is and 
it has been a problem for a few years, through many PP versions. You can see 
the general issue reported here:

http://tex.stackexchange.com/questions/140814/biblatex-biber-fails-with-a-strange-error-about-missing-recode-data-xml-file

 From what I have seen, when this file is missing, all of the .pm files in inc/ 
are missing too although I cannot reliably reproduce this. It is a very 
frequent error from many users on various platforms and I’d very much like to 
find out why it happens …
I'm fairly confident that PAR::Packer doesn't meddle with the files in the cache area of
a pp-packed executable. AFAICT there's nothing in the code to delete files 
there (except
to purge the whole cache area immediatly after running the executable).
At least for *nix installations I can think of an explanation: administrative cron jobs that clean up
/tmp, /var/tmp etc by purging files not modified for some time. Dunno for 
Windows, esp.
since the "temp" directories there are typically specific to each user.
Cheers, Roderich
--
Dr Philip Kime


Reply via email to