Quote:
Originally Posted by Pierre-Marie Baty
w000H00H00H00H00000000t!!!!
// if you know a more orthodox way of doing this, please tell me.
// test file, if found = STEAM Linux/Win32 dedicated server
fp = fopen ("valve/steam.inf", "rb");
if (fp != NULL)
{
fclose (fp); // test was successful, close it
is_steam = mTRUE; // this file is typical from a STEAM DS install
}
|
A more orthodox way of testing if a file exists instead of trying to open it?
Sure:
#include <sys/stat.h>
struct _stat buf;
if( _stat( "valve/steam.inf", &buf ) == 0 )
{
//file exists
}
Quote:
Originally Posted by Pierre-Marie Baty
Hey thanks Austin
is it portable ?
|
Totally,
Standard c lib stuff.