Lines Matching refs:path
94 int mkdir_p(char *path, mode_t mode)
98 char *d = path;
103 if (stat(path, &st) == 0)
110 err = stat(path, &st) && mkdir(path, mode);
117 return (stat(path, &st) && mkdir(path, mode)) ? -1 : 0;
139 * 0 - will remove only files under the 'path' directory
140 * 1 .. x - will dive in x-level deep under the 'path' directory
151 static int rm_rf_depth_pat(const char *path, int depth, const char **pat)
160 ret = lstat(path, &statbuf);
166 return unlink(path);
168 /* We have directory in path. */
169 dir = opendir(path);
184 path, d->d_name);
203 return rmdir(path);
206 static int rm_rf_a_kcore_dir(const char *path, const char *name)
216 snprintf(kcore_dir_path, sizeof(kcore_dir_path), "%s/%s", path, name);
232 static int rm_rf_kcore_dir(const char *path)
238 kcore_dirs = lsdir(path, kcore_dir_filter);
244 ret = rm_rf_a_kcore_dir(path, nd->s);
254 int rm_rf_perf_data(const char *path)
262 rm_rf_kcore_dir(path);
264 return rm_rf_depth_pat(path, 0, pat);
267 int rm_rf(const char *path)
269 return rm_rf_depth_pat(path, INT_MAX, NULL);
562 char path[PATH_MAX];
568 snprintf(path, sizeof(path), "/proc/%d/fd/%d", getpid(), fd);
569 err = scandir(path, namelist, filter, compar);