示例#1
0
bool FolderExists(const KString& FolderName)
{
	if(FolderName.IsEmpty())
		return false;

	TCHAR CurDir[1024];
	_tgetcwd(CurDir, sizeof(CurDir) - 1);

	const bool bResult = _tchdir(UnslashedFolderName(FolderName)) ? false : true;

	_tchdir(CurDir);

	return bResult;
}
示例#2
0
bool FileExists(const KString& FileName)
{
	if(FileName.IsEmpty())
		return false;

	FILE *file = _tfopen(FileName,TEXT("rb"));

	if(file)
	{
		fclose(file);
		return true;
	}

	return false;
}