aboutsummaryrefslogtreecommitdiff
path: root/CPP/Windows/FileDir.h
diff options
context:
space:
mode:
Diffstat (limited to 'CPP/Windows/FileDir.h')
-rw-r--r--CPP/Windows/FileDir.h41
1 files changed, 39 insertions, 2 deletions
diff --git a/CPP/Windows/FileDir.h b/CPP/Windows/FileDir.h
index 573ffa2..9ba98fc 100644
--- a/CPP/Windows/FileDir.h
+++ b/CPP/Windows/FileDir.h
@@ -18,9 +18,20 @@ bool GetSystemDir(FString &path);
18WIN32 API : SetFileTime() doesn't allow to set zero timestamps in file 18WIN32 API : SetFileTime() doesn't allow to set zero timestamps in file
19but linux : allows unix time = 0 in filesystem 19but linux : allows unix time = 0 in filesystem
20*/ 20*/
21 21/*
22SetDirTime() can be used to set time for file or for dir.
23If path is symbolic link, SetDirTime() will follow symbolic link,
24and it will set timestamps of symbolic link's target file or dir.
25*/
22bool SetDirTime(CFSTR path, const CFiTime *cTime, const CFiTime *aTime, const CFiTime *mTime); 26bool SetDirTime(CFSTR path, const CFiTime *cTime, const CFiTime *aTime, const CFiTime *mTime);
23 27
28/*
29SetLinkFileTime() doesn't follow symbolic link,
30and it sets timestamps for symbolic link file itself.
31If (path) is not symbolic link, it still can work (at least in some new OS versions).
32*/
33bool SetLinkFileTime(CFSTR path, const CFiTime *cTime, const CFiTime *aTime, const CFiTime *mTime);
34
24 35
25#ifdef _WIN32 36#ifdef _WIN32
26 37
@@ -41,7 +52,26 @@ int my_chown(CFSTR path, uid_t owner, gid_t group);
41bool SetFileAttrib_PosixHighDetect(CFSTR path, DWORD attrib); 52bool SetFileAttrib_PosixHighDetect(CFSTR path, DWORD attrib);
42 53
43 54
55#ifndef _WIN32
56#define PROGRESS_CONTINUE 0
57#define PROGRESS_CANCEL 1
58// #define PROGRESS_STOP 2
59// #define PROGRESS_QUIET 3
60#endif
61Z7_PURE_INTERFACES_BEGIN
62DECLARE_INTERFACE(ICopyFileProgress)
63{
64 // in: total, current: include all/processed alt streams.
65 // it returns PROGRESS_CONTINUE or PROGRESS_CANCEL.
66 virtual DWORD CopyFileProgress(UInt64 total, UInt64 current) = 0;
67};
68Z7_PURE_INTERFACES_END
69
44bool MyMoveFile(CFSTR existFileName, CFSTR newFileName); 70bool MyMoveFile(CFSTR existFileName, CFSTR newFileName);
71// (progress == NULL) is allowed
72bool MyMoveFile_with_Progress(CFSTR oldFile, CFSTR newFile,
73 ICopyFileProgress *progress);
74
45 75
46#ifndef UNDER_CE 76#ifndef UNDER_CE
47bool MyCreateHardLink(CFSTR newFileName, CFSTR existFileName); 77bool MyCreateHardLink(CFSTR newFileName, CFSTR existFileName);
@@ -59,6 +89,11 @@ bool CreateComplexDir(CFSTR path);
59 89
60bool DeleteFileAlways(CFSTR name); 90bool DeleteFileAlways(CFSTR name);
61bool RemoveDirWithSubItems(const FString &path); 91bool RemoveDirWithSubItems(const FString &path);
92#ifdef _WIN32
93bool RemoveDirAlways_if_Empty(const FString &path);
94#else
95#define RemoveDirAlways_if_Empty RemoveDir
96#endif
62 97
63bool MyGetFullPathName(CFSTR path, FString &resFullPath); 98bool MyGetFullPathName(CFSTR path, FString &resFullPath);
64bool GetFullPathAndSplit(CFSTR path, FString &resDirPrefix, FString &resFileName); 99bool GetFullPathAndSplit(CFSTR path, FString &resDirPrefix, FString &resFileName);
@@ -87,7 +122,9 @@ public:
87 bool Create(CFSTR pathPrefix, NIO::COutFile *outFile); // pathPrefix is not folder prefix 122 bool Create(CFSTR pathPrefix, NIO::COutFile *outFile); // pathPrefix is not folder prefix
88 bool CreateRandomInTempFolder(CFSTR namePrefix, NIO::COutFile *outFile); 123 bool CreateRandomInTempFolder(CFSTR namePrefix, NIO::COutFile *outFile);
89 bool Remove(); 124 bool Remove();
90 bool MoveTo(CFSTR name, bool deleteDestBefore); 125 // bool MoveTo(CFSTR name, bool deleteDestBefore);
126 bool MoveTo(CFSTR name, bool deleteDestBefore,
127 ICopyFileProgress *progress);
91}; 128};
92 129
93 130