From 75e05bc441382db69c842a64c562738cb749214e Mon Sep 17 00:00:00 2001 From: "B. Stack" Date: Sun, 22 Jan 2023 13:56:55 -0500 Subject: add upstream 12.0 --- zen/file_access.h | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'zen/file_access.h') diff --git a/zen/file_access.h b/zen/file_access.h index d87fcd0d..5af8b879 100644 --- a/zen/file_access.h +++ b/zen/file_access.h @@ -8,6 +8,7 @@ #define FILE_ACCESS_H_8017341345614857 #include +#include #include "file_path.h" #include "file_error.h" #include "serialize.h" //IoCallback @@ -17,10 +18,6 @@ namespace zen { //note: certain functions require COM initialization! (vista_file_op.h) -//POSITIVE existence checks; if false: 1. item not existing 2. different type 3.device access error or similar -bool fileAvailable(const Zstring& filePath); //noexcept -bool dirAvailable (const Zstring& dirPath ); // - //FAT/FAT32: "Why does the timestamp of a file *increase* by up to 2 seconds when I copy it to a USB thumb drive?" const int FAT_FILE_TIME_PRECISION_SEC = 2; //https://devblogs.microsoft.com/oldnewthing/?p=83 //https://web.archive.org/web/20141127143832/http://support.microsoft.com/kb/127830 @@ -42,7 +39,9 @@ ItemType getItemType(const Zstring& itemPath); //throw FileError //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 itemStillExists(const Zstring& itemPath); //throw FileError +std::variant getItemTypeIfExists(const Zstring& itemPath); //throw FileError + +bool itemExists(const Zstring& itemPath); //throw FileError enum class ProcSymlink { -- cgit