QFile::remove() fails only on Windows?
The following code fails at dbFile.remove(), but only on Windows (at least Win7). Any clues why? I am truly sorry I cannot provide a minimal example. I thought maybe it was that the sql database is somehow still accessing the file even after I close and remove it, but I dunno. I am just frustrated and out of time and thought you experts might have conjectures.
The file in question has read/write access by the user, and the permissions are 0x6666.
The error string after dbFile.remove() is: "The process cannot access the file because it is being used by another process."
Code:
void Database::load()
{
...
dbFileName = "database.sqlite"; // QString
dbFile.setFileName(dbFileName); // QFile
sqldb.setDatabaseName(dbFileName);
dbIsOpen = sqldb.open();
dbConName = sqldb.connectionName();
...
}
void Database::unload()
{
bool removed = dbFile.remove();
}