Win Delete Database?
#1
It's possible to delete some .db from Database folder in windows while running XBMC, and if not some command to delete on close?

In linux, we can delete .db files and don't have the error that are being used, in windows the .db is locked because is being used. How to resolve this?
I'm trying to make a script to delete Thumbnails folder and the respective db, so it creates next time it boot.
Reply
#2
Yes, you need to use something like this:

Code:
profilePath = xbmc.translatePath(os.path.join('special://userdata/addon_data/youraddon', ''))
profilePath = profilePath + 'yourdatabase.db'
os.remove(profilePath)
Reply
#3
The problem is not removing a db from my addon, is removing a XBMC db (Textures.db and Addons.db)
In windows I get a message telling that the files can't be deleted as they are being used.

I created a workaround, for windows with a batch file like this:
Code:
Taskkill /IM XBMC.exe /F
timeout 3
del pathtodb
pause

In linux or rpi I don't have any problem and can use the os.remove, as the files aren't locked by XBMC process in those cases.

But I was looking for a native way of doing this without a cmd.exe appearing to user.
Reply
#4
Did you ever find an internal solution to this?

Sent from my X15
Reply
#5
OK, zombie thread, but I'll see if I can answer. There is no internal solution for this because the db files mentioned by the OP are actually in use by Kodi. Deletely them while Kodi is running will cause very strange things to happen. Really, deleting them at all will be less than optimal.
Reply

Logout Mark Read Team Forum Stats Members Help
Delete Database?0