MCPcopy Create free account
hub / github.com/OpenXcom/OpenXcom / fileExists

Function fileExists

src/Engine/CrossPlatform.cpp:621–637  ·  view source on GitHub ↗

* Checks if a certain path exists and is a file. * @param path Full path to file. * @return Does it exist? */

Source from the content-addressed store, hash-verified

619 * @return Does it exist?
620 */
621bool fileExists(const std::string &path)
622{
623#ifdef _WIN32
624 return (PathFileExistsA(path.c_str()) != FALSE);
625#elif __MORPHOS__
626 BPTR l = Lock( path.c_str(), SHARED_LOCK );
627 if( l != NULL )
628 {
629 UnLock( l );
630 return 1;
631 }
632 return 0;
633#else
634 struct stat info;
635 return (stat(path.c_str(), &info) == 0 && S_ISREG(info.st_mode));
636#endif
637}
638
639/**
640 * Removes a file from the specified path.

Callers 11

handleMethod · 0.85
caseInsensitiveFunction · 0.85
initMethod · 0.85
saveAIMapMethod · 0.85
saveVoxelViewMethod · 0.85
XcomResourcePackMethod · 0.85
loadMusicMethod · 0.85
saveGameMethod · 0.85
initMethod · 0.85
initMethod · 0.85
ArticleStateArmorMethod · 0.85

Calls 1

statClass · 0.85

Tested by

no test coverage detected