#include <sys/stat.h>  
#include <io.h>  
 
bool FileExist(const char* FileName)  
{  
    struct stat my_stat;  
    return (stat(FileName, &my_stat) == 0);  
}  
 
 
bool IsDirectory(const char* FileName)  
{  
    struct stat my_stat;  
    if (stat(FileName, &my_stat) != 0) return false;  
    return ((my_stat.st_mode & S_IFDIR) != 0);  

 

posted on 2009-06-22 17:10  pchgo  阅读(215)  评论(0编辑  收藏  举报