| 1211 | |
| 1212 | |
| 1213 | static bool check_for_file(thread_db* tdbb, const SCHAR* name, USHORT length) |
| 1214 | { |
| 1215 | /************************************** |
| 1216 | * |
| 1217 | * c h e c k _ f o r _ f i l e |
| 1218 | * |
| 1219 | ************************************** |
| 1220 | * |
| 1221 | * Functional description |
| 1222 | * Check for the existence of a file. |
| 1223 | * Return true if it is there. |
| 1224 | * |
| 1225 | **************************************/ |
| 1226 | |
| 1227 | SET_TDBB(tdbb); |
| 1228 | Database* dbb = tdbb->getDatabase(); |
| 1229 | const Firebird::PathName path(name, length); |
| 1230 | |
| 1231 | try { |
| 1232 | // This use of PIO_open is NOT checked against DatabaseAccess configuration |
| 1233 | // parameter. It's not required, because here we only check for presence of |
| 1234 | // existing file, never really use (or create) it. |
| 1235 | jrd_file* temp_file = PIO_open(tdbb, path, path); |
| 1236 | PIO_close(temp_file); |
| 1237 | } // try |
| 1238 | catch (const Firebird::Exception& ex) |
| 1239 | { |
| 1240 | ex.stuffException(tdbb->tdbb_status_vector); |
| 1241 | return false; |
| 1242 | } |
| 1243 | |
| 1244 | return true; |
| 1245 | } |
| 1246 | |
| 1247 | #ifdef NOT_USED_OR_REPLACED |
| 1248 | static void check_if_got_ast(thread_db* tdbb, jrd_file* file) |
no test coverage detected