3 # aNetHack 0.0.1 recover.pl $ANH-Date$ $ANH-Branch$:$ANH-Revision$
4 # Copyright (c) Kenneth Lorber, Kensington, Maryland, 2009
5 # aNetHack may be freely redistributed. See license for details.
7 # Wrapper for 3.4.3 recover to be called from Applescript to reset the Qt
8 # package after it locks up due to a bug in suspend handling.
10 # find the right place
11 ($playground = $0) =~ s!/recover.pl$!!;
13 print "Cannot find playground $playground.";
16 if(! -f
"$playground/castle.lev" && ! -f
"$playground/anhdat"){
17 print "Failed to find playground $playground.";
20 print "Playground is $playground.\n";
21 chdir $playground or do {
22 print "Can't get to playground.\n";
26 print "Attempting to remove perm_lock.\n";
30 print "Did not find perm_lock (this is OK).\n";
33 print "Failed to remove perm_lock: $!\n";
37 print "Removed perm_lock.\n";
40 # run recover, but only if there is something that looks promising
41 $recover = "./recover";
42 $recover = "/usr/local/bin/recover" unless(-e
$recover);
45 foreach ( <$uid*.0> ){
46 system ("$recover -d . $_");