diff options
author | Daniel Wilhelm <daniel@wili.li> | 2014-04-18 17:12:46 +0200 |
---|---|---|
committer | Daniel Wilhelm <daniel@wili.li> | 2014-04-18 17:12:46 +0200 |
commit | b338e29fd3eaf700f8c8360aa0310048ba941d54 (patch) | |
tree | 122f8ef3790d12cd10275ef7453a9e8053322d78 /shared/file_id.cpp | |
parent | 3.18 (diff) | |
download | FreeFileSync-b338e29fd3eaf700f8c8360aa0310048ba941d54.tar.gz FreeFileSync-b338e29fd3eaf700f8c8360aa0310048ba941d54.tar.bz2 FreeFileSync-b338e29fd3eaf700f8c8360aa0310048ba941d54.zip |
3.19
Diffstat (limited to 'shared/file_id.cpp')
-rw-r--r-- | shared/file_id.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/shared/file_id.cpp b/shared/file_id.cpp index b111b9a2..da8fd815 100644 --- a/shared/file_id.cpp +++ b/shared/file_id.cpp @@ -36,7 +36,6 @@ std::string util::retrieveFileID(const Zstring& filename) //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(), @@ -68,13 +67,16 @@ std::string util::retrieveFileID(const Zstring& filename) fileID += numberToBytes(fileInfo.st_ino); } #endif - + assert(!fileID.empty()); return fileID; } bool util::sameFileSpecified(const Zstring& file1, const Zstring& file2) { + if (EqualFilename()(file1, file2)) //quick check + return true; + const std::string id1 = retrieveFileID(file1); const std::string id2 = retrieveFileID(file2); |