News:

Check out the MegaGlest Wiki! Anyone can be an editor, and we want you!

Main Menu

made a mistake on the return values for the last post

Started by mini_me, 28 June 2010, 23:49:13

mini_me

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;

}

titi

Why don't you post it in the thread where it belongs?
I first thought you are a forum spambot!



Try Megaglest! Improved Engine / New factions / New tilesets / New maps / New scenarios

ultifd