d00_ape Posted September 6, 2004 Share Posted September 6, 2004 I know there is a small function that checks if a file exists but I can?t find it. Link to comment Share on other sites More sharing options...
0 Sn1p3t Posted September 6, 2004 Share Posted September 6, 2004 I know there is a small function that checks if a file exists but I can?t find it. For what language? Link to comment Share on other sites More sharing options...
0 smurfiness Posted September 6, 2004 Share Posted September 6, 2004 Win32, use the FindFirstFile API function. .NET, use the System.IO.File.Exists function. Link to comment Share on other sites More sharing options...
0 +virtorio MVC Posted September 6, 2004 MVC Share Posted September 6, 2004 DWORD dwAtt = GetFileAttributes( lpzFileName ); if (dwAtt == INVALID_FILE_ATTRIBUTES) ::MessageBox(hwnd, "File/Directory does not exist", "Exists?", MB_OK | MB_ICONINFORMATION); else if ( (dwAtt & FILE_ATTRIBUTE_DIRECTORY) ) ::MessageBox(hwnd, "Directory exists", "Exists?", MB_OK | MB_ICONINFORMATION); else ::MessageBox(hwnd, "File Exists", "Exists?", MB_OK | MB_ICONINFORMATION); Link to comment Share on other sites More sharing options...
0 d00_ape Posted September 6, 2004 Author Share Posted September 6, 2004 Perfect!! Tnx Link to comment Share on other sites More sharing options...
Question
d00_ape
I know there is a small function that checks if a file exists but I can?t find it.
Link to comment
Share on other sites
4 answers to this question
Recommended Posts