cask icon indicating copy to clipboard operation
cask copied to clipboard

Avoid panic when access to existing file

Open kination opened this issue 4 years ago • 2 comments

Hello, bit wonder of asking cause it seems not being maintained...

When trying to use this module, creating DB works well, but it fails when trying to access existing database as:

thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Io(Os { code: 17, kind: AlreadyExists, message: "File exists" })', src/...

I've tried both as

let cask_db = CaskOptions::default()
            .compaction_check_frequency(1200)
            .sync(SyncStrategy::Interval(5000))
            .max_file_size(1024 * 1024 * 1024)
            .open("test.db").unwrap();

and

let cask_opt = CaskOptions::default();
let cask_db = Cask::open("test.db", cask_opt).unwrap();

Is there a correct way to read existing database?

kination avatar Apr 11 '21 12:04 kination

You are right that is not actively maintained and you shouldn't use this in any kind of production scenario.

That aside, I have tried this and couldn't replicate the panic. Maybe you could re-run with RUST_BACKTRACE=1? I tested this on Linux, what OS are you using?

andresilva avatar Jun 13 '21 18:06 andresilva

@andresilva I'm testing on Mac(M1)

kination avatar Jun 18 '21 09:06 kination