浏览代码

activarte is_file and is_directory in os android

mikymod 12 年之前
父节点
当前提交
465fea8289
共有 1 个文件被更改,包括 8 次插入10 次删除
  1. 8 10
      engine/os/android/AndroidOS.cpp

+ 8 - 10
engine/os/android/AndroidOS.cpp

@@ -131,21 +131,19 @@ bool exists(const char* path)
 //-----------------------------------------------------------------------------
 bool is_directory(const char* path)
 {
-	// struct stat info;
-	// memset(&info, 0, sizeof(struct stat));
-	// lstat(path, &info);
-	// return ((S_ISDIR(info.st_mode)) != 0 && (S_ISLNK(info.st_mode) == 0));
-	return true;
+	struct stat info;
+	memset(&info, 0, sizeof(struct stat));
+	lstat(path, &info);
+	return ((S_ISDIR(info.st_mode)) != 0 && (S_ISLNK(info.st_mode) == 0));
 }
 
 //-----------------------------------------------------------------------------
 bool is_file(const char* path)
 {
-	// struct stat info;
-	// memset(&info, 0, sizeof(struct stat));
-	// lstat(path, &info);
-	// return ((S_ISREG(info.st_mode) != 0) && (S_ISLNK(info.st_mode) == 0));
-	return true;
+	struct stat info;
+	memset(&info, 0, sizeof(struct stat));
+	lstat(path, &info);
+	return ((S_ISREG(info.st_mode) != 0) && (S_ISLNK(info.st_mode) == 0));
 }
 
 //-----------------------------------------------------------------------------