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