Lines Matching defs:path
75 int lstat(const char *path, struct stat *buffer)
77 return stat(path, buffer);
151 int chdir(const char *path)
158 if (!path) {
163 if (!strlen(path)) {
168 if (strlen(path) > PATH_MAX) {
173 ret = vfs_normalize_path((const char *)NULL, path, &fullpath);
176 return -1; /* build path failed */
200 PRINT_ERR("chdir path error!\n");
205 /* release normalize directory path name */
256 int chmod(const char *path, mode_t mode)
263 ret = chattr(path, &attr);
293 int access(const char *path, int amode)
299 ret = statfs(path, &fsBuf);
312 ret = stat(path, &buf);
442 static char *ls_get_fullpath(const char *path, struct dirent *pdirent)
447 if (path[1] != '\0') {
448 /* 2, The position of the path character: / and the end character '/0' */
449 fullpath = (char *)malloc(strlen(path) + strlen(pdirent->d_name) + 2);
454 /* 2, The position of the path character: / and the end character '/0' */
455 ret = snprintf_s(fullpath, strlen(path) + strlen(pdirent->d_name) + 2,
456 strlen(path) + strlen(pdirent->d_name) + 1, "%s/%s", path, pdirent->d_name);
463 /* 2, The position of the path character: / and the end character '/0' */
469 /* 2, The position of the path character: / and the end character '/0' */
551 int LsFile(const char *path)
557 if (stat64(path, &stat64Info) == 0) {
559 readlink(path, linkName, NAME_MAX);
561 PrintFileInfo64(&stat64Info, path, (const char *)linkName);
562 } else if (stat(path, &statInfo) == 0) {
564 readlink(path, linkName, NAME_MAX);
566 PrintFileInfo(&statInfo, path, (const char *)linkName);
574 int LsDir(const char *path)
584 d = opendir(path);
589 PRINTK("Directory %s:\n", path);
601 fullpath = ls_get_fullpath(path, pdirent);
631 char *path = NULL;
642 path = strdup(curr->files->workdir);
645 path = strdup("/");
647 if (path == NULL) {
651 ret = vfs_normalize_path(NULL, pathname, &path);
658 ret = stat(path, &statInfo);
661 free(path);
666 ret = LsDir((pathname == NULL) ? path : pathname);
668 ret = LsFile(path);
674 free(path);
679 char *realpath(const char *path, char *resolved_path)
685 ret = vfs_normalize_path(NULL, path, &new_path);
762 int chroot(const char *path)
767 if (!path) {
772 if (!strlen(path)) {
777 if (strlen(path) > PATH_MAX) {
782 ret = VnodeLookup(path, &vnode, 0);