X-Git-Url: http://www.git.stargrave.org/?p=public-inbox.git;a=blobdiff_plain;f=lib%2FPublicInbox%2FOver.pm;h=30f2603f7d2a4324d02c1900593c4a80253ba790;hp=07e54b64ca5de9448a4cf35399faaa37d7e6295a;hb=2a353273079b2491cbceb20526d3c9dbf43d8f62;hpb=cfb8d16578e7f2f2e300f9f436205e4a8fc7f322 diff --git a/lib/PublicInbox/Over.pm b/lib/PublicInbox/Over.pm index 07e54b64..30f2603f 100644 --- a/lib/PublicInbox/Over.pm +++ b/lib/PublicInbox/Over.pm @@ -15,7 +15,11 @@ use Compress::Zlib qw(uncompress); sub dbh_new { my ($self) = @_; my $ro = ref($self) eq 'PublicInbox::Over'; - my $dbh = DBI->connect("dbi:SQLite:dbname=$self->{filename}",'','', { + my $f = $self->{filename}; + if (!$ro && !-f $f) { # SQLite defaults mode to 0644, we want 0666 + open my $fh, '+>>', $f or die "failed to open $f: $!"; + } + my $dbh = DBI->connect("dbi:SQLite:dbname=$f",'','', { AutoCommit => 1, RaiseError => 1, PrintError => 0,