The Windows API function GetFileAttributes can do that.
Code to use it could look something like this:
-------------------
#include <windows.h>
const DWORD NOT_FOUND = 0xFFFFFFFF;
DWORD attribs = GetFileAttributes(file_name_char_str);
if (attribs != NOT_FOUND) // if a file or dir of that name exists
{
if (attribs & FILE_ATTRIBUTE_DIRECTORY)
// it is a directory
else
// it is a file
}
-------------------
. Ed
Post by didanis there any way to check whether a certain file exists without
using fopen ?
Thanks for help