From 80300df3f45c7e1947dc072cd65a7f27019a4059 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 30 Aug 2012 19:27:53 +0530 Subject: [PATCH] samefile_windows(); Return true if the strings are the same upto case differences. --- src/calibre/utils/filenames.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/calibre/utils/filenames.py b/src/calibre/utils/filenames.py index c843100157..d9fd12d466 100644 --- a/src/calibre/utils/filenames.py +++ b/src/calibre/utils/filenames.py @@ -203,6 +203,11 @@ def samefile_windows(src, dst): import win32file from pywintypes import error + samestring = (os.path.normcase(os.path.abspath(src)) == + os.path.normcase(os.path.abspath(dst))) + if samestring: + return True + def get_fileid(x): if isbytestring(x): x = x.decode(filesystem_encoding) try: