MCPcopy Create free account
hub / github.com/assimp/assimp / Exists

Method Exists

code/Common/DefaultIOSystem.cpp:95–117  ·  view source on GitHub ↗

------------------------------------------------------------------------------------------------ Tests for the existence of a file at the given path.

Source from the content-addressed store, hash-verified

93// ------------------------------------------------------------------------------------------------
94// Tests for the existence of a file at the given path.
95bool DefaultIOSystem::Exists(const char *pFile) const {
96 if (pFile == nullptr) {
97 return false;
98 }
99
100#ifdef _WIN32
101 struct __stat64 filestat;
102 if (_wstat64(Utf8ToWide(pFile).c_str(), &filestat) != 0) {
103 return false;
104 }
105#else
106 struct stat statbuf;
107 if (stat(pFile, &statbuf) != 0) {
108 return false;
109 }
110 // test for a regular file
111 if (!S_ISREG(statbuf.st_mode)) {
112 return false;
113 }
114#endif
115
116 return true;
117}
118
119// ------------------------------------------------------------------------------------------------
120// Open a new file with a given path.

Callers 13

readDataMethod · 0.45
expandFileMethod · 0.45
load_file_into_bufferMethod · 0.45
CanReadMethod · 0.45
ExportScene3MFFunction · 0.45
D3MFOpcPackageMethod · 0.45
validateMethod · 0.45
OpenReaderMethod · 0.45
OpenXmlParserMethod · 0.45
FindLWOFileMethod · 0.45
ReadFileMethod · 0.45

Calls 2

Utf8ToWideFunction · 0.85
statClass · 0.70

Tested by

no test coverage detected