SQLite Forum

Opening a DB with SQLITE_OPEN_EXCLUSIVE
Login
Hello, I'm a developer who uses SQLite in various projects. I ran into the exact same problem. I'd like to avoid any race conditions with creating database files. For this, the `O_EXCL` flag (and by extension, the `SQLITE_OPEN_EXCLUSIVE` flag) would be perfect. I do not understand why I cannot use it, as it prevents me from writing correct, robust code. All I want is that the `sqlite3_open_v2()` call fails when the database file already exists. What puzzles me is that the original poster is instructed to work around the issue without any explanation as to why the seemingly erroneous behaviour is kept in SQLite. Is this bug report officially rejected?