> I don't see any reason to not include this function into photo module API

Eh, I don't know about that. It seems to be too ad-hoc to me to include in the module itself, at least in its current state. That's not the topic of discussion right now though, so I'll leave it at that.

I will concede that sometimes working with a directory directly is easier than using `getDataPath` on every individual file, though.

> I can simplify getDataPath() method, and remove this buggy fopen check (because neither name or smth else don't restrict me to use directory path here).

Removing it entirely doesn't sit well with me. The check helps to detect missing files early. I do agree, though, that the name isn't the best. How about this then: instead of a boolean parameter, have an enum that takes the values of `FILE` and `DIRECTORY` (with an appropriate prefix, of course). If it's `FILE`, then the function checks it's a file. If it's `DIRECTORY`, it checks that it's a directory.