schrodinger / maeparser

maestro file parser
MIT License
23 stars 23 forks source link

Added stream opening checks to Reader & Writer #45

Closed ricrogz closed 5 years ago

ricrogz commented 5 years ago

Addresses #42

By checking the stream state in the file name constructors of the Reader and Writer classes we can detect problems like file/path existence and permissions before actually trying to read/write to files. This an early way of differentiating these problems from actual reading/writing errors (i.e. reading a malformed file).

d-b-w commented 5 years ago

I'm requesting a review from Pat and leaving this open for today because I want to double check whether openbabel or rdkit would need changes based on this.

ricrogz commented 5 years ago

Does this obviate some of your changes in mmshare?

Yes, in mmshare I added a quick boost::filesystem to check the existence of the file being read. I will replace with a check for these exceptions as soon as this is merged.

lorton commented 5 years ago

I think we'll probably have to add exception wrapping to rdkit/openbabel for this call. OpenBabel still hasn't even merged so that's no big deal. RDKit is pinned to a release, so we just need to make sure to add exception checking to the PR to update them to the next release of maeparser.