-/**
- * Wrapper around fs::exists that can handle invalid file names.
- * In theory we could test with fs::native whether a filename is valid
- * before calling fs::exists, but in practice it is unusable: On windows it
- * does not allow spaces, and on unix it does not allow absolute file names.
- * This function has the disadvantage that it catches also other errors than
- * invalid names, but for dependency checking we can live with that.
- */
-bool exists(FileName const & possible_name) {
- try {
- return fs::exists(possible_name.toFilesystemEncoding());
- }
- catch (fs::filesystem_error const & fe) {
- LYXERR(Debug::DEPEND) << "Got error `" << fe.what()
- << "' while checking whether file `" << possible_name
- << "' exists." << endl;
- return false;
- }
-}
-
-