diff options
author | Daniel Wilhelm <daniel@wili.li> | 2014-04-18 17:24:09 +0200 |
---|---|---|
committer | Daniel Wilhelm <daniel@wili.li> | 2014-04-18 17:24:09 +0200 |
commit | 110fc5dee14fc7988f631a158e50d283446aba7a (patch) | |
tree | 7c19dfd3bdb8c4636409ec80a38c70499ac006db /zen/file_id.cpp | |
parent | 5.14 (diff) | |
download | FreeFileSync-110fc5dee14fc7988f631a158e50d283446aba7a.tar.gz FreeFileSync-110fc5dee14fc7988f631a158e50d283446aba7a.tar.bz2 FreeFileSync-110fc5dee14fc7988f631a158e50d283446aba7a.zip |
5.15
Diffstat (limited to 'zen/file_id.cpp')
-rw-r--r-- | zen/file_id.cpp | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/zen/file_id.cpp b/zen/file_id.cpp index 7e0fa81b..8c66d1c9 100644 --- a/zen/file_id.cpp +++ b/zen/file_id.cpp @@ -19,9 +19,7 @@ zen::FileId zen::getFileID(const Zstring& filename) { #ifdef FFS_WIN - //WARNING: CreateFile() is SLOW, while GetFileInformationByHandle() is cheap! - //http://msdn.microsoft.com/en-us/library/aa363788(VS.85).aspx - + //WARNING: CreateFile() is SLOW, while GetFileInformationByHandle() is cheap! http://msdn.microsoft.com/en-us/library/aa363788(VS.85).aspx //privilege SE_BACKUP_NAME doesn't seem to be required here at all const HANDLE hFile = ::CreateFile(zen::applyLongPathPrefix(filename).c_str(), @@ -49,17 +47,19 @@ zen::FileId zen::getFileID(const Zstring& filename) return zen::FileId(); } - -bool zen::samePhysicalFile(const Zstring& file1, const Zstring& file2) -{ - if (EqualFilename()(file1, file2)) //quick check - return true; - - const auto id1 = getFileID(file1); - const auto id2 = getFileID(file2); - - if (id1 == zen::FileId() || id2 == zen::FileId()) - return false; - - return id1 == id2; -} +//test whether two distinct paths point to the same file or directory: +// true: paths point to same files/dirs +// false: error occurred OR point to different files/dirs +//bool zen::samePhysicalFile(const Zstring& file1, const Zstring& file2) +//{ +// if (EqualFilename()(file1, file2)) //quick check +// return true; +// +// const auto id1 = getFileID(file1); +// const auto id2 = getFileID(file2); +// +// if (id1 == zen::FileId() || id2 == zen::FileId()) +// return false; +// +// return id1 == id2; +//} |