my $f = delete $self->{filename};
if (!-f $f) { # SQLite defaults mode to 0644, we want 0666
if ($rw) {
+ require PublicInbox::Spawn;
open my $fh, '+>>', $f or die "failed to open $f: $!";
+ PublicInbox::Spawn::set_nodatacow(fileno($fh));
+ my $j = "$f-journal";
+ open $fh, '+>>', $j or die "failed to open $j: $!";
+ PublicInbox::Spawn::set_nodatacow(fileno($fh));
} else {
$self->{filename} = $f; # die on stat() below:
}
$st = pack('dd', $st[0], $st[1]);
} while ($st ne $self->{st} && $tries++ < 3);
warn "W: $f: .st_dev, .st_ino unstable\n" if $st ne $self->{st};
+ $dbh->do('PRAGMA synchronous = OFF') if ($rw // 0) > 1;
$dbh;
}