MegaGlest Forum

Archives (read only) => Vanilla Glest => Linux and other ports => Topic started by: mini_me on 28 June 2010, 23:49:13

Title: made a mistake on the return values for the last post
Post 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;

}
Title: Re: made a mistake on the return values for the last post
Post by: titi 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!
Title: Re: made a mistake on the return values for the last post
Post by: ultifd on 30 June 2010, 17:40:38
I think he edited it after...oh well.