Lines Matching refs:path

66 bool GetWindowsDir(FString &path)

76 path = fas2fs(s);
84 path = us2fs(s);
92 returned path does not end with a backslash unless the
96 bool GetSystemDir(FString &path)
106 path = fas2fs(s);
114 path = us2fs(s);
121 bool SetDirTime(CFSTR path, const CFiTime *cTime, const CFiTime *aTime, const CFiTime *mTime)
133 hDir = ::CreateFileW(fs2us(path), GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE,
139 if (GetSuperPath(path, superPath, USE_MAIN_PATH))
156 bool SetFileAttrib(CFSTR path, DWORD attrib)
161 if (::SetFileAttributes(fs2fas(path), attrib))
168 if (::SetFileAttributesW(fs2us(path), attrib))
174 if (GetSuperPath(path, superPath, USE_MAIN_PATH))
183 bool SetFileAttrib_PosixHighDetect(CFSTR path, DWORD attrib)
189 return SetFileAttrib(path, attrib);
193 bool RemoveDir(CFSTR path)
198 if (::RemoveDirectory(fs2fas(path)))
205 if (::RemoveDirectoryW(fs2us(path)))
211 if (GetSuperPath(path, superPath, USE_MAIN_PATH))
321 bool CreateDir(CFSTR path)
326 if (::CreateDirectory(fs2fas(path), NULL))
333 if (::CreateDirectoryW(fs2us(path), NULL))
339 if (GetSuperPath(path, superPath, USE_MAIN_PATH))
351 path must be WITHOUT trailing path separator.
356 static bool CreateDir2(CFSTR path)
361 if (::CreateDirectory(fs2fas(path), NULL))
368 if (::CreateDirectoryW(fs2us(path), NULL))
374 if (GetSuperPath(path, superPath, USE_MAIN_PATH))
391 if (!fi.Find(path))
398 static bool CreateDir2(CFSTR path);
431 FString path (_path);
433 int pos = path.ReverseFind_PathSepar();
434 if (pos >= 0 && (unsigned)pos == path.Len() - 1)
436 if (path.Len() == 1)
438 path.DeleteBack();
441 const FString path2 (path);
442 pos = (int)path.Len();
446 if (CreateDir2(path))
450 pos = path.ReverseFind_PathSepar();
455 if (pos == 1 && IS_PATH_SEPAR(path[0]))
461 path.DeleteFrom((unsigned)pos);
471 path.SetFrom(path2, (unsigned)pos);
472 if (!CreateDir(path))
482 bool DeleteFileAlways(CFSTR path)
487 DWORD attrib = NFind::GetFileAttrib(path);
492 if (!SetFileAttrib(path, attrib & ~(DWORD)FILE_ATTRIBUTE_READONLY))
500 if (::DeleteFile(fs2fas(path)))
509 if (::DeleteFileW(fs2us(path)))
515 if (GetSuperPath(path, superPath, USE_MAIN_PATH))
525 bool RemoveDirWithSubItems(const FString &path)
530 if (!fi.Find(path))
543 FString s (path);
577 if (!SetFileAttrib(path, 0))
579 return RemoveDir(path);
586 bool MyGetFullPathName(CFSTR path, FString &resFullPath)
588 resFullPath = path;
594 bool MyGetFullPathName(CFSTR path, FString &resFullPath)
596 return GetFullPath(path, resFullPath);
602 doesn't support super prefix "\\?\", if long path behavior is not
605 bool SetCurrentDir(CFSTR path)
610 return BOOLToBool(::SetCurrentDirectory(fs2fas(path)));
615 return BOOLToBool(::SetCurrentDirectoryW(fs2us(path)));
633 the returned (path) does not end with a backslash, if
638 bool GetCurrentDir(FString &path)
641 path.Empty();
652 path = fas2fs(s);
668 path = us2fs(s);
685 path = us2fs(temp);
694 bool GetFullPathAndSplit(CFSTR path, FString &resDirPrefix, FString &resFileName)
696 bool res = MyGetFullPathName(path, resDirPrefix);
698 resDirPrefix = path;
706 bool GetOnlyDirPrefix(CFSTR path, FString &resDirPrefix)
709 return GetFullPathAndSplit(path, resDirPrefix, resFileName);
714 bool MyGetTempPath(FString &path)
732 path = fas2fs(s);
740 path = us2fs(s);
742 /* win10: GetTempPathW() doesn't set backslash at the end of path,
744 So we normalize path here: */
745 NormalizeDirPathPrefix(path);
751 path = STRING_PATH_SEPARATOR "tmp";
753 if (NFind::DoesDirExist_FollowLink(path))
757 path = s;
799 FString path (prefix);
800 path += postfix;
801 if (NFind::DoesFileOrDirExist(path))
808 if (outFile->Create(path, false))
813 if (CreateDir(path))
922 bool RemoveDir(CFSTR path)
924 return (rmdir(path) == 0);
978 bool CreateDir(CFSTR path)
980 return (mkdir(path, 0777) == 0); // change it
983 static bool CreateDir2(CFSTR path)
985 return (mkdir(path, 0777) == 0); // change it
989 bool DeleteFileAlways(CFSTR path)
991 return (remove(path) == 0);
994 bool SetCurrentDir(CFSTR path)
996 return (chdir(path) == 0);
1000 bool GetCurrentDir(FString &path)
1002 path.Empty();
1011 path = fas2fs(s);
1022 path = fas2fs(res);
1045 bool SetDirTime(CFSTR path, const CFiTime *cTime, const CFiTime *aTime, const CFiTime *mTime)
1053 printf("\nstat = %s\n", path);
1054 int ret = stat(path, &st);
1082 return utime(path, &buf) == 0;
1105 return utimensat(AT_FDCWD, path, times, flags) == 0;
1133 PRF(printf("\nSetFileAttrib(%s, %x) : %s\n", (const char *)path, attrib, msg);)
1136 PRF(printf("\n chmod(%s, %o)\n", (const char *)path, (unsigned)(mode));)
1138 int my_chown(CFSTR path, uid_t owner, gid_t group)
1140 return chown(path, owner, group);
1143 bool SetFileAttrib_PosixHighDetect(CFSTR path, DWORD attrib)
1152 if (lstat(path, &st) != 0)
1161 if (stat(path, &st) != 0)
1203 TRACE_chmod(path, (st.st_mode) & g_umask.mask)
1205 res = fchmodat(AT_FDCWD, path, (st.st_mode) & g_umask.mask,
1211 TRACE_chmod(path, (st.st_mode) & g_umask.mask)
1212 res = chmod(path, (st.st_mode) & g_umask.mask);