diff options
author | Daniel Wilhelm <shieldwed@outlook.com> | 2019-01-16 00:44:17 +0000 |
---|---|---|
committer | Daniel Wilhelm <shieldwed@outlook.com> | 2019-01-16 00:44:17 +0000 |
commit | c03ea582bff36fe020af1aa329b34f3e6d580f92 (patch) | |
tree | 41b8a3085df4de883f2993773b138f1436e041a4 /zen/file_access.h | |
parent | Merge branch '10.7' into 'master' (diff) | |
parent | 10.8 (diff) | |
download | FreeFileSync-c03ea582bff36fe020af1aa329b34f3e6d580f92.tar.gz FreeFileSync-c03ea582bff36fe020af1aa329b34f3e6d580f92.tar.bz2 FreeFileSync-c03ea582bff36fe020af1aa329b34f3e6d580f92.zip |
Merge branch '10.8' into 'master'10.8
10.8
See merge request opensource-tracking/FreeFileSync!5
Diffstat (limited to 'zen/file_access.h')
-rwxr-xr-x | zen/file_access.h | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/zen/file_access.h b/zen/file_access.h index 514d798e..d981dcc3 100755 --- a/zen/file_access.h +++ b/zen/file_access.h @@ -52,10 +52,17 @@ enum class ProcSymlink }; void setFileTime(const Zstring& filePath, time_t modTime, ProcSymlink procSl); //throw FileError -//symlink handling: always evaluate target -uint64_t getFileSize(const Zstring& filePath); //throw FileError +//symlink handling: always follow uint64_t getFreeDiskSpace(const Zstring& path); //throw FileError, returns 0 if not available -FileId /*optional*/ getFileId(const Zstring& itemPath); //throw FileError + +struct FileDetails +{ + uint64_t fileSize = 0; + time_t modTime = 0; //number of seconds since Jan. 1st 1970 UTC + VolumeId volumeId = 0; +}; +//symlink handling: always follow +FileDetails getFileDetails(const Zstring& itemPath); //throw FileError //get per-user directory designated for temporary files: Zstring getTempFolderPath(); //throw FileError @@ -65,8 +72,7 @@ void removeSymlinkPlain (const Zstring& linkPath); //throw FileError; E void removeDirectoryPlain(const Zstring& dirPath ); //throw FileError; ERROR if not existing void removeDirectoryPlainRecursion(const Zstring& dirPath); //throw FileError; ERROR if not existing -//rename file or directory: no copying!!! -void renameFile(const Zstring& itemPathOld, const Zstring& itemPathNew); //throw FileError, ErrorDifferentVolume, ErrorTargetExisting +void moveAndRenameItem(const Zstring& itemPathOld, const Zstring& itemPathNew, bool replaceExisting); //throw FileError, ErrorDifferentVolume, ErrorTargetExisting bool supportsPermissions(const Zstring& dirPath); //throw FileError, follows symlinks //copy permissions for files, directories or symbolic links: requires admin rights @@ -94,9 +100,9 @@ struct FileCopyResult std::optional<FileError> errorModTime; //failure to set modification time }; -FileCopyResult copyNewFile(const Zstring& sourceFile, const Zstring& targetFile, bool copyFilePermissions, //throw FileError, ErrorTargetExisting, ErrorFileLocked +FileCopyResult copyNewFile(const Zstring& sourceFile, const Zstring& targetFile, bool copyFilePermissions, //throw FileError, ErrorTargetExisting, ErrorFileLocked, X //accummulated delta != file size! consider ADS, sparse, compressed files - const IOCallback& notifyUnbufferedIO); //may be nullptr; throw X! + const IOCallback& notifyUnbufferedIO /*throw X*/); } #endif //FILE_ACCESS_H_8017341345614857 |