Article ID: 168439
Article Last Modified on 9/7/2005
//Sample.cpp
/* Compiler Options : none */
#include <sys/types.h>
#include <sys/stat.h>
#include <stdio.h>
#include <windows.h>
HANDLE hSearch;
WIN32_FIND_DATA Buf;
int main( void )
{
struct _stat buf;
int result;
result = _stat( "c:\\temp", &buf );
if( result != 0 )
printf( "_stat function on c:\\temp failed " );
result = _stat( "c:\\temp\\", &buf );
if( result != 0 )
printf( "_stat function on c:\\temp\\ failed " );
hSearch= FindFirstFile((LPSTR)"c:\\temp", &Buf);
if (hSearch == INVALID_HANDLE_VALUE )
printf("\n\n FindFirstFile on c:\\temp failed too");
hSearch= FindFirstFile((LPSTR)"c:\\temp\\", &Buf);
if (hSearch == INVALID_HANDLE_VALUE )
printf("\n\n FindFirstFile on c:\\temp\\ failed too");
return 0;
}
Program output:_stat function on c:\temp\ failed.If you experience the C1010 error when you compile the sample code in Visual Studio .NET, click the following article number to view the article in the Microsoft Knowledge Base:
FindFirstFile on c:\temp\ failed, too.
815644 Most common causes of C1010 error
Keywords: kbtshoot kbprb KB168439