MCPcopy Create free account
hub / github.com/FirebirdSQL/firebird / check_for_file

Function check_for_file

src/jrd/sdw.cpp:1213–1245  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1211
1212
1213static 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
1248static void check_if_got_ast(thread_db* tdbb, jrd_file* file)

Callers 1

SDW_startFunction · 0.85

Calls 5

SET_TDBBFunction · 0.85
getDatabaseMethod · 0.80
PIO_openFunction · 0.50
PIO_closeFunction · 0.50
stuffExceptionMethod · 0.45

Tested by

no test coverage detected