• Home
  • Raw
  • Download

Lines Matching refs:fullpath

72     CHAR *fullpath = NULL;  in OsShellCmdDoChdir()  local
90 ret = VfsNormalizePath(shellWorkingDirectory, path, &fullpath); in OsShellCmdDoChdir()
93 fullpathBak = fullpath; in OsShellCmdDoChdir()
94 dirent = opendir(fullpath); in OsShellCmdDoChdir()
107 ret = strncpy_s(shellWorkingDirectory, PATH_MAX, fullpath, strlen(fullpath)); in OsShellCmdDoChdir()
122 CHAR *fullpath = NULL; in OsLsGetFullpath() local
128 fullpath = (CHAR *)malloc(pathLen); in OsLsGetFullpath()
129 if (fullpath == NULL) { in OsLsGetFullpath()
133 ret = snprintf_s(fullpath, pathLen, pathLen - 1, "%s/%s", path, pdirent->d_name); in OsLsGetFullpath()
135 free(fullpath); in OsLsGetFullpath()
140 fullpath = (CHAR *)malloc(pathLen); in OsLsGetFullpath()
141 if (fullpath == NULL) { in OsLsGetFullpath()
145 ret = snprintf_s(fullpath, pathLen, pathLen, "/%s", pdirent->d_name); in OsLsGetFullpath()
147 free(fullpath); in OsLsGetFullpath()
152 return fullpath; in OsLsGetFullpath()
161 CHAR *fullpath = NULL; in OsLs() local
191 fullpath = OsLsGetFullpath(path, pdirent); in OsLs()
192 if (fullpath == NULL) { in OsLs()
198 fullpathBak = fullpath; in OsLs()
199 if (stat(fullpath, &statInfo) == 0) { in OsLs()
220 CHAR *fullpath = NULL; in OsShellCmdLs() local
236 ret = VfsNormalizePath(shellWorkingDirectory, filename, &fullpath); in OsShellCmdLs()
239 OsLs(fullpath); in OsShellCmdLs()
240 free(fullpath); in OsShellCmdLs()
263 CHAR *fullpath = NULL; in OsShellCmdCat() local
276 ret = VfsNormalizePath(shellWorkingDirectory, argv[0], &fullpath); in OsShellCmdCat()
279 INT32 fd = open(fullpath, O_RDONLY, 0666); in OsShellCmdCat()
283 free(fullpath); in OsShellCmdCat()
291 free(fullpath); in OsShellCmdCat()
299 free(fullpath); in OsShellCmdCat()
308 CHAR *fullpath = NULL; in OsShellCmdMkdir() local
318 ret = VfsNormalizePath(shellWorkingDirectory, filename, &fullpath); in OsShellCmdMkdir()
321 ret = mkdir(fullpath, S_IRWXU | S_IRWXG | S_IRWXO); in OsShellCmdMkdir()
325 free(fullpath); in OsShellCmdMkdir()
355 CHAR *fullpath = NULL; in OsShellCmdTouch() local
365 ret = VfsNormalizePath(shellWorkingDirectory, filename, &fullpath); in OsShellCmdTouch()
368 fd = open(fullpath, O_RDWR | O_CREAT, 0777); in OsShellCmdTouch()
369 free(fullpath); in OsShellCmdTouch()
526 CHAR *fullpath = NULL; in OsShellCmdDoRmdir() local
548 fullpath = (CHAR *)malloc(fullPathBufSize); in OsShellCmdDoRmdir()
549 if (fullpath == NULL) { in OsShellCmdDoRmdir()
554 …ret = snprintf_s(fullpath, fullPathBufSize, fullPathBufSize - 1, "%s/%s", pathname, dirent->d_name… in OsShellCmdDoRmdir()
557 free(fullpath); in OsShellCmdDoRmdir()
561 (VOID)OsShellCmdDoRmdir(fullpath); in OsShellCmdDoRmdir()
562 free(fullpath); in OsShellCmdDoRmdir()
630 STATIC INT32 OsRmFileOnly(const CHAR *fullpath) in OsRmFileOnly() argument
633 INT32 ret = stat(fullpath, &statInfo); in OsRmFileOnly()
636 ret = unlink(fullpath); in OsRmFileOnly()
639 PRINTK("rm: cannot remove '%s': Is a directory\n", fullpath); in OsRmFileOnly()
642 PRINTK("stat: get '%s' statInfo fail!\n", fullpath); in OsRmFileOnly()
649 STATIC INT32 OsWildcardDeleteFileOrDir(const CHAR *fullpath, wildcard_type mark) in OsWildcardDeleteFileOrDir() argument
655 ret = OsShellCmdDoRmdir(fullpath); in OsWildcardDeleteFileOrDir()
658 ret = OsRmFileOnly(fullpath); in OsWildcardDeleteFileOrDir()
661 ret = rmdir(fullpath); in OsWildcardDeleteFileOrDir()
667 PRINTK("%s ", fullpath); in OsWildcardDeleteFileOrDir()
676 STATIC CHAR *OsWildcardSplitPath(CHAR *fullpath, CHAR **handle, CHAR **wait) in OsWildcardSplitPath() argument
681 INT32 len = strlen(fullpath); in OsWildcardSplitPath()
684 if (fullpath[n] == '/') { in OsWildcardSplitPath()
686 fullpath[n] = '\0'; in OsWildcardSplitPath()
687 *wait = fullpath + n + 1; in OsWildcardSplitPath()
691 } else if (fullpath[n] == '*' || fullpath[n] == '?') { in OsWildcardSplitPath()
693 fullpath[a] = '\0'; in OsWildcardSplitPath()
695 *handle = fullpath + a + 1; in OsWildcardSplitPath()
698 *handle = fullpath + a + 1; in OsWildcardSplitPath()
701 return fullpath; in OsWildcardSplitPath()
706 STATIC INT32 OsWildcardExtractDirectory(CHAR *fullpath, VOID *dst, wildcard_type mark) in OsWildcardExtractDirectory() argument
719 f = OsWildcardSplitPath(fullpath, &s, &t); in OsWildcardExtractDirectory()
723 ret = OsShellCmdDoCp(fullpath, dst); in OsWildcardExtractDirectory()
725 ret = stat(fullpath, &statBuf); in OsWildcardExtractDirectory()
730 ret = OsWildcardDeleteFileOrDir(fullpath, mark); in OsWildcardExtractDirectory()
904 CHAR *fullpath = NULL; in OsShellCmdRm() local
918 ret = VfsNormalizePath(shellWorkingDirectory, filename, &fullpath); in OsShellCmdRm()
921 if (OsIsContainersWildcard(fullpath)) { in OsShellCmdRm()
922 ret = OsWildcardExtractDirectory(fullpath, NULL, RM_RECURSIVER); in OsShellCmdRm()
924 ret = OsShellCmdDoRmdir(fullpath); in OsShellCmdRm()
928 ret = VfsNormalizePath(shellWorkingDirectory, filename, &fullpath); in OsShellCmdRm()
931 if (OsIsContainersWildcard(fullpath)) { in OsShellCmdRm()
932 ret = OsWildcardExtractDirectory(fullpath, NULL, RM_FILE); in OsShellCmdRm()
934 ret = OsRmFileOnly(fullpath); in OsShellCmdRm()
940 free(fullpath); in OsShellCmdRm()
947 CHAR *fullpath = NULL; in OsShellCmdRmdir() local
957 ret = VfsNormalizePath(shellWorkingDirectory, filename, &fullpath); in OsShellCmdRmdir()
960 if (OsIsContainersWildcard(fullpath)) { in OsShellCmdRmdir()
961 ret = OsWildcardExtractDirectory(fullpath, NULL, RM_DIR); in OsShellCmdRmdir()
963 ret = rmdir(fullpath); in OsShellCmdRmdir()
966 PRINTK("rmdir %s failed. Error: %s.\n", fullpath, strerror(errno)); in OsShellCmdRmdir()
968 free(fullpath); in OsShellCmdRmdir()