summaryrefslogtreecommitdiff
path: root/zen/file_access.h
diff options
context:
space:
mode:
authorB. Stack <bgstack15@gmail.com>2022-09-07 14:49:22 -0400
committerB. Stack <bgstack15@gmail.com>2022-09-07 14:49:22 -0400
commit47c88c433d17948fab1d8e1d76121a72fe5938cb (patch)
treefbc1dea58a6b28f1af4a9e9b2bc8e3e1d23b2103 /zen/file_access.h
parentMerge branch 'b11.23' into 'master' (diff)
downloadFreeFileSync-47c88c433d17948fab1d8e1d76121a72fe5938cb.tar.gz
FreeFileSync-47c88c433d17948fab1d8e1d76121a72fe5938cb.tar.bz2
FreeFileSync-47c88c433d17948fab1d8e1d76121a72fe5938cb.zip
add upstream 11.24
Diffstat (limited to 'zen/file_access.h')
-rw-r--r--zen/file_access.h14
1 files changed, 4 insertions, 10 deletions
diff --git a/zen/file_access.h b/zen/file_access.h
index 17c47731..f6a02edc 100644
--- a/zen/file_access.h
+++ b/zen/file_access.h
@@ -29,12 +29,7 @@ using FileIndex = ino_t;
using FileTimeNative = timespec;
inline time_t nativeFileTimeToTimeT(const timespec& ft) { return ft.tv_sec; } //follow Windows Explorer and always round down!
-inline timespec timetToNativeFileTime(time_t utcTime)
-{
- timespec natTime = {};
- natTime.tv_sec = utcTime;
- return natTime;
-}
+inline timespec timetToNativeFileTime(time_t utcTime) { return {.tv_sec = utcTime}; }
enum class ItemType
{
@@ -44,15 +39,14 @@ enum class ItemType
};
//(hopefully) fast: does not distinguish between error/not existing
ItemType getItemType(const Zstring& itemPath); //throw FileError
-//execute potentially SLOW folder traversal but distinguish error/not existing
-// assumes: - base path still exists
-// - all child item path parts must correspond to folder traversal
+//execute potentially SLOW folder traversal but distinguish error/not existing:
+// - all child item path parts must correspond to folder traversal
// => we can conclude whether an item is *not* existing anymore by doing a *case-sensitive* name search => potentially SLOW!
std::optional<ItemType> itemStillExists(const Zstring& itemPath); //throw FileError
enum class ProcSymlink
{
- direct,
+ asLink,
follow
};
void setFileTime(const Zstring& filePath, time_t modTime, ProcSymlink procSl); //throw FileError
bgstack15