App-Codit
view release on metacpan or search on metacpan
lib/App/Codit.pm view on Meta::CPAN
my $self = shift;
my $file = $self->configGet('-configfolder') . '/lockfile';
return $file if -e $file;
return undef
}
sub lockModified {
my $self = shift;
my $file = $self->configGet('-configfolder') . '/lockfile';
if (-e $file) {
my ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$mtime,$ctime,$blksize,$blocks) = stat($file);
my $lmod = $self->{LOCKMODIFIED};
return $lmod ne $mtime if defined $lmod;
}
return ''
}
sub lockReset {
my $self = shift;
my $file = $self->configGet('-configfolder') . '/lockfile';
if (open(LOUT, '>', $file)) {
print LOUT "\n";
close LOUT
}
my ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$mtime,$ctime,$blksize,$blocks) = stat($file);
$self->{LOCKMODIFIED} = $mtime;
}
sub lockScan {
my $self = shift;
return unless $self->lockModified;
$self->deiconify unless $self->ismapped;
$self->focus;
$self->raise;
if (my $file = $self->lockfile) {
( run in 1.104 second using v1.01-cache-2.11-cpan-49f99fa48dc )