MegaGlest Forum
Archives (read only) => Vanilla Glest => Linux and other ports => Topic started by: mini_me on 28 June 2010, 23:49:13
-
made a mistake on the return values for the last post
I realized that when viewing the logical operator &&, so it should be 1 or 0...
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
int isdir(const char *path)
{
struct stat stats;
if(stat(path,&stats) == 0 && S_ISDIR(stats.st_mode) == 0)
return 0;
else
return -1;
}
-
Why don't you post it in the thread where it belongs?
I first thought you are a forum spambot!
-
I think he edited it after...oh well.