Lines Matching defs:dirname
28 int MakeDir(const char *dirname)
30 if (access(dirname, F_OK) == 0) {
31 LOG("dir:%s exists", dirname);
34 int rt = mkdir(dirname, S_IRUSR | S_IWUSR | S_IXUSR | S_IRWXG | S_IXOTH);
36 LOG("create dir failed! path=%s, errno=%d:%s", dirname, errno, strerror(errno));
43 int RemoveDir(const char *dirname)
48 if (stat(dirname, &dirStat) < 0) {
54 DIR *pDir = opendir(dirname);
62 sprintf(subDir, "%s/%s", dirname, fname);
66 if (rmdir(dirname) == -1) { // delete empty dir
67 LOG("delete empty directory failed, path=%s, errno=%d:%s", dirname, errno, strerror(errno));
71 if (remove(dirname) == -1) {
72 LOG("remove regular file failed, path=%s, errno=%d:%s", dirname, errno, strerror(errno));