How to check if a folder is a database folder and if it's already open?

OK, thanks. The “LOCK” seems to be easy, reading the manifest could be a bit more effort. I’ll try that.