mirror of
https://codeberg.org/scip/note.git
synced 2025-12-17 20:51:02 +01:00
fix #1
This commit is contained in:
@@ -5,7 +5,7 @@
|
|||||||
#
|
#
|
||||||
package NOTEDB::binary;
|
package NOTEDB::binary;
|
||||||
|
|
||||||
$NOTEDB::binary::VERSION = "1.11";
|
$NOTEDB::binary::VERSION = "1.12";
|
||||||
|
|
||||||
use strict;
|
use strict;
|
||||||
use IO::Seekable;
|
use IO::Seekable;
|
||||||
@@ -29,16 +29,16 @@ sub new {
|
|||||||
bless($self,$class);
|
bless($self,$class);
|
||||||
|
|
||||||
$self->{NOTEDB} = $self->{dbname} = $param{dbname} || File::Spec->catfile($ENV{HOME}, ".notedb");
|
$self->{NOTEDB} = $self->{dbname} = $param{dbname} || File::Spec->catfile($ENV{HOME}, ".notedb");
|
||||||
my $MAX_NOTE = $param{max_note} || 4096;
|
my $MAX_NOTE = $param{MaxNoteByte} || 4096;
|
||||||
my $MAX_TIME = $param{max_time} || 64;
|
my $MAX_TIME = $param{MaxTimeByte} || 64;
|
||||||
|
|
||||||
if(! -e $self->{NOTEDB}) {
|
if(! -e $self->{NOTEDB}) {
|
||||||
open(TT,">$self->{NOTEDB}") or die "Could not create $self->{NOTEDB}: $!\n";
|
open(TT,">$self->{NOTEDB}") or die "Could not create $self->{NOTEDB}: $!\n";
|
||||||
close (TT);
|
close (TT);
|
||||||
}
|
}
|
||||||
elsif(! -w $self->{NOTEDB}) {
|
elsif(! -w $self->{NOTEDB}) {
|
||||||
print "$self->{NOTEDB} is not writable!\n";
|
print "$self->{NOTEDB} is not writable!\n";
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -51,31 +51,31 @@ sub new {
|
|||||||
$self->{LOCKFILE} = $self->{NOTEDB} . "~LOCK";
|
$self->{LOCKFILE} = $self->{NOTEDB} . "~LOCK";
|
||||||
|
|
||||||
return $self;
|
return $self;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
sub DESTROY
|
sub DESTROY
|
||||||
{
|
{
|
||||||
# clean the desk!
|
# clean the desk!
|
||||||
}
|
}
|
||||||
|
|
||||||
sub version {
|
sub version {
|
||||||
my $this = shift;
|
my $this = shift;
|
||||||
return $NOTEDB::binary::VERSION;
|
return $NOTEDB::binary::VERSION;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
sub set_del_all
|
sub set_del_all
|
||||||
{
|
{
|
||||||
my $this = shift;
|
my $this = shift;
|
||||||
unlink $this->{NOTEDB};
|
unlink $this->{NOTEDB};
|
||||||
open(TT,">$this->{NOTEDB}") or die "Could not create $this->{NOTEDB}: $!\n";
|
open(TT,">$this->{NOTEDB}") or die "Could not create $this->{NOTEDB}: $!\n";
|
||||||
close (TT);
|
close (TT);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
sub get_single {
|
sub get_single {
|
||||||
my($this, $num) = @_;
|
my($this, $num) = @_;
|
||||||
my($address, $note, $date, $n, $t, $buffer, );
|
my($address, $note, $date, $n, $t, $buffer, );
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user