摘要: 1 #include <iostream> // for std::cout 2 #include <utility> // for std::pair 3 #include <algorithm> // for std::for_each 4 #include <vector> 5 using namespace std; 6 7 #include <string.h> 8 9 int main()10 {11 char temp[100] = "/a/b/c/d/e";12 char file[100];13 阅读全文
posted @ 2011-11-30 16:54 吃吃户 阅读(335) 评论(0) 推荐(0) 编辑
摘要: 1 #include <unistd.h> 2 #include <sys/stat.h> 3 #include <stdio.h> 4 5 bool IsFileRead(const char * file_name) 6 { 7 int ret = access(file_name, R_OK); 8 /* 9 W_OK可写 X_OK可执行 F_OK是否存在10 */11 if (ret == 0)12 return true;13 return false;14 }15 bool IsRegFile(const char * ... 阅读全文
posted @ 2011-11-30 10:14 吃吃户 阅读(257) 评论(0) 推荐(0) 编辑