{I+=codeWee;}
[C++] How do I check if a directory is a file or folder?
bool IsDirectory(const wchar_t* filename)
{
	if ((GetFileAttributesW(filename) & FILE_ATTRIBUTE_DIRECTORY) == FILE_ATTRIBUTE_DIRECTORY)
		return true;
	else
		return false;
}

bool IsDirectory(const char* filename)
{
	if ((GetFileAttributes(filename) & FILE_ATTRIBUTE_DIRECTORY) == FILE_ATTRIBUTE_DIRECTORY)
		return true;
	else
		return false;
}

//-----------------------------------------------

#include "Shlwapi.h"
#pragma comment(lib , "Shlwapi.lib")

BOOL IsDirectory(LPCTSTR pszPath)
{
	return PathIsDirectory(pszPath);
)
HTML | PHP | C++ | DirectX11 | Javascript | C# | HTML5 | ASP | SQL | General | CSS | Oculus Rift | Unity3d | Virtools SDK | Tip | NSIS | PowerShell | node.js | Web API | RTSP | All
Copyright© 2016 CodeWee.com All rights reserved.