Author Topic: made a mistake on the return values for the last post  (Read 2224 times)

mini_me

  • Guest
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

  • MegaGlest Team
  • Airship
  • ********
  • Posts: 4,227
    • View Profile
    • http://www.titusgames.de
Re: made a mistake on the return values for the last post
« Reply #1 on: 30 June 2010, 12:35:20 »
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

  • Airship
  • ********
  • Posts: 4,443
  • The Glest Video Guy :) The one and only. :P
    • View Profile
    • My Youtube Channel
Re: made a mistake on the return values for the last post
« Reply #2 on: 30 June 2010, 17:40:38 »
I think he edited it after...oh well.