FileExists

BlackDice 0 Tallied Votes 120 Views Share

returns TRUE or FALSE depending on whether or not a file exists

BOOL FileExists(CString strFolderName)
{   
	return GetFileAttributes(strFolderName) != INVALID_FILE_ATTRIBUTES;   
}
ribon69 0 Newbie Poster

the best!

1o0oBhP 4 Posting Pro in Training

I take it it needs <windows.h>?

ShawnCplus 456 Code Monkey Team Colleague

Did you get the idea from the console command, IF EXIST?

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

the standard C library stat() is more portable to other operating systems.

venomlash 55 Junior Poster

Coooooooooooooooooooooooool.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.