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

Function folderExists

src/Engine/CrossPlatform.cpp:598–614  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

596 * @return Does it exist?
597 */
598bool folderExists(const std::string &path)
599{
600#ifdef _WIN32
601 return (PathIsDirectoryA(path.c_str()) != FALSE);
602#elif __MORPHOS__
603 BPTR l = Lock( path.c_str(), SHARED_LOCK );
604 if( l != NULL )
605 {
606 UnLock( l );
607 return 1;
608 }
609 return 0;
610#else
611 struct stat info;
612 return (stat(path.c_str(), &info) == 0 && S_ISDIR(info.st_mode));
613#endif
614}
615
616/**
617 * Checks if a certain path exists and is a file.

Callers 4

setFoldersFunction · 0.85
updateOptionsFunction · 0.85
caseInsensitiveFolderFunction · 0.85
loadMethod · 0.85

Calls 1

statClass · 0.85

Tested by

no test coverage detected