Click here to Skip to main content
15,912,665 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Connecting to DB2 using VC++ 6.0 Pin
Bill Wilson21-May-02 11:43
Bill Wilson21-May-02 11:43 
GeneralRe: Connecting to DB2 using VC++ 6.0 Pin
markkuk21-May-02 20:23
markkuk21-May-02 20:23 
GeneralTesting File Existence Pin
Srini Kella21-May-02 4:26
Srini Kella21-May-02 4:26 
GeneralRe: Testing File Existence Pin
Doug Joseph21-May-02 4:34
Doug Joseph21-May-02 4:34 
GeneralRe: Testing File Existence Pin
Srini Kella21-May-02 5:24
Srini Kella21-May-02 5:24 
GeneralRe: Testing File Existence Pin
Doug Joseph22-May-02 4:16
Doug Joseph22-May-02 4:16 
GeneralRe: Testing File Existence Pin
David Crow5-Jan-04 7:47
David Crow5-Jan-04 7:47 
GeneralRe: Testing File Existence Pin
Alvaro Mendez21-May-02 4:42
Alvaro Mendez21-May-02 4:42 
Here's some old code I have that does it:

#include < sys/stat.h >
 
// Returns true if the given szFile is a valid file.
bool IsFile(const char* szFile)
{
	assert(szFile);
 
	struct stat statBuffer;
	return (stat(szFile, &statBuffer) >= 0 &&		// make sure it exists
		statBuffer.st_mode & S_IFREG);		// and it's not a directory
}


I'm not really sure what you mean by it needing to be asynchronous. I think what you need is a way to just check for existence and nothing else. Well, this should do it.

Regards,
Alvaro


Insanity: doing the same thing over and over again and expecting different results. - Albert Einstein
GeneralRe: Testing File Existence Pin
Srini Kella21-May-02 5:26
Srini Kella21-May-02 5:26 
GeneralRe: Testing File Existence Pin
Alvaro Mendez21-May-02 6:01
Alvaro Mendez21-May-02 6:01 
GeneralRe: Testing File Existence Pin
Martin Ziacek21-May-02 6:07
Martin Ziacek21-May-02 6:07 
Generalglobal carray Pin
jafrazee21-May-02 4:00
jafrazee21-May-02 4:00 
GeneralRe: global carray Pin
Martin Ziacek21-May-02 4:12
Martin Ziacek21-May-02 4:12 
GeneralRe: global carray Pin
jafrazee21-May-02 4:16
jafrazee21-May-02 4:16 
GeneralRe: global carray Pin
Martin Ziacek21-May-02 4:34
Martin Ziacek21-May-02 4:34 
GeneralRe: global carray Pin
Renjith Ramachandran21-May-02 4:23
Renjith Ramachandran21-May-02 4:23 
GeneralRe: global carray Pin
jafrazee21-May-02 4:30
jafrazee21-May-02 4:30 
GeneralRe: global carray Pin
Doug Joseph21-May-02 4:29
Doug Joseph21-May-02 4:29 
Generaldata update problem Pin
jimNLX21-May-02 3:40
jimNLX21-May-02 3:40 
GeneralRe: data update problem Pin
lucy21-May-02 5:51
lucy21-May-02 5:51 
GeneralRe: data update problem Pin
jimNLX21-May-02 6:27
jimNLX21-May-02 6:27 
GeneralShellexec, "mailto:" Pin
21-May-02 2:53
suss21-May-02 2:53 
GeneralRe: Shellexec, "mailto:" Pin
Nish Nishant21-May-02 4:38
sitebuilderNish Nishant21-May-02 4:38 
GeneralRe: Shellexec, "mailto:" Pin
Jason Henderson21-May-02 4:40
Jason Henderson21-May-02 4:40 
GeneralRe: Shellexec, "mailto:" Pin
PJ Arends21-May-02 5:49
professionalPJ Arends21-May-02 5:49 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.