summaryrefslogtreecommitdiffstats
path: root/Source/cmSystemTools.cxx
diff options
context:
space:
mode:
authorBill Hoffman <bill.hoffman@kitware.com>2001-11-21 22:45:01 (GMT)
committerBill Hoffman <bill.hoffman@kitware.com>2001-11-21 22:45:01 (GMT)
commit12551a33c394cd06a082f2df2ad550e38d762a98 (patch)
tree7d1358ac4841807d28ea9e2d7f18b65390df7acf /Source/cmSystemTools.cxx
parent66135bee42c1743eab8f4f64d87585a9824d6d37 (diff)
downloadCMake-12551a33c394cd06a082f2df2ad550e38d762a98.zip
CMake-12551a33c394cd06a082f2df2ad550e38d762a98.tar.gz
CMake-12551a33c394cd06a082f2df2ad550e38d762a98.tar.bz2
NMake with spaces in directories
Diffstat (limited to 'Source/cmSystemTools.cxx')
-rw-r--r--Source/cmSystemTools.cxx19
1 files changed, 19 insertions, 0 deletions
diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx
index 517d500..6e6abfe 100644
--- a/Source/cmSystemTools.cxx
+++ b/Source/cmSystemTools.cxx
@@ -397,6 +397,25 @@ std::string cmSystemTools::EscapeQuotes(const char* str)
return result;
}
+bool cmSystemTools::SameFile(const char* file1, const char* file2)
+{
+ struct stat fileStat1, fileStat2;
+ if (stat(file1, &fileStat1) == 0 && stat(file2, &fileStat2) == 0)
+ {
+ // see if the files are the same file
+ // check the device inode and size
+ if(fileStat2.st_dev == fileStat1.st_dev &&
+ fileStat2.st_ino == fileStat1.st_ino &&
+ fileStat2.st_size == fileStat1.st_size
+ )
+ {
+ return true;
+ }
+ }
+ return false;
+}
+
+
// return true if the file exists
bool cmSystemTools::FileExists(const char* filename)
{