From de73d25e0b27f4bee2de116d19cab32800785d64 Mon Sep 17 00:00:00 2001 From: Daniel Wilhelm Date: Fri, 2 Oct 2015 14:56:07 +0200 Subject: 7.2 --- zen/file_access.h | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) (limited to 'zen/file_access.h') diff --git a/zen/file_access.h b/zen/file_access.h index 0dfb650e..4b1c31dd 100644 --- a/zen/file_access.h +++ b/zen/file_access.h @@ -14,10 +14,10 @@ namespace zen { -bool fileExists (const Zstring& filepath); //noexcept; check whether file or file-symlink exists -bool dirExists (const Zstring& dirpath ); //noexcept; check whether directory or dir-symlink exists -bool symlinkExists (const Zstring& linkname); //noexcept; check whether a symbolic link exists -bool somethingExists(const Zstring& objname ); //noexcept; check whether any object with this name exists +bool fileExists (const Zstring& filePath); //noexcept; check whether file or file-symlink exists +bool dirExists (const Zstring& dirPath ); //noexcept; check whether directory or dir-symlink exists +bool symlinkExists (const Zstring& linkPath); //noexcept; check whether a symbolic link exists +bool somethingExists(const Zstring& itemPath); //noexcept; check whether any object with this name exists enum class ProcSymlink { @@ -25,27 +25,29 @@ enum class ProcSymlink FOLLOW }; -void setFileTime(const Zstring& filepath, std::int64_t modificationTime, ProcSymlink procSl); //throw FileError +void setFileTime(const Zstring& filePath, std::int64_t modificationTime, ProcSymlink procSl); //throw FileError //symlink handling: always evaluate target -std::uint64_t getFilesize(const Zstring& filepath); //throw FileError +std::uint64_t getFilesize(const Zstring& filePath); //throw FileError std::uint64_t getFreeDiskSpace(const Zstring& path); //throw FileError, returns 0 if not available -bool removeFile(const Zstring& filepath); //throw FileError; return "false" if file is not existing -void removeDirectory(const Zstring& directory, //throw FileError - const std::function& onBeforeFileDeletion = nullptr, //optional; - const std::function& onBeforeDirDeletion = nullptr); //one call for each *existing* object! +bool removeFile(const Zstring& filePath); //throw FileError; return "false" if file is not existing + +void removeDirectorySimple(const Zstring& dirPath); //throw FileError + +void removeDirectoryRecursively(const Zstring& dirPath); //throw FileError //rename file or directory: no copying!!! void renameFile(const Zstring& itemPathOld, const Zstring& itemPathNew); //throw FileError, ErrorDifferentVolume, ErrorTargetExisting bool supportsPermissions(const Zstring& dirpath); //throw FileError, dereferences symlinks -//if parent directory not existing: create recursively: -void makeNewDirectory(const Zstring& directory); //throw FileError, ErrorTargetExisting +//- no error if already existing +//- create recursively if parent directory is not existing +void makeDirectoryRecursively(const Zstring& dirpath); //throw FileError //fail if already existing or parent directory not existing: -//directory should not end with path separator +//source path is optional (may be empty) void copyNewDirectory(const Zstring& sourcePath, const Zstring& targetPath, bool copyFilePermissions); //throw FileError, ErrorTargetExisting, ErrorTargetPathMissing void copySymlink(const Zstring& sourceLink, const Zstring& targetLink, bool copyFilePermissions); //throw FileError -- cgit