diff options
author | Andy Cedilnik <andy.cedilnik@kitware.com> | 2004-01-26 20:50:38 (GMT) |
---|---|---|
committer | Andy Cedilnik <andy.cedilnik@kitware.com> | 2004-01-26 20:50:38 (GMT) |
commit | 09421a261c188763d3acfc7155d49c1c6fabc3ae (patch) | |
tree | 6a84cb27ae5956d4996016fc05efcae76d920a31 /Source/cmSystemTools.cxx | |
parent | 900ad59867f7949b1b3a46ed53adc2d0197b8bb7 (diff) | |
download | CMake-09421a261c188763d3acfc7155d49c1c6fabc3ae.zip CMake-09421a261c188763d3acfc7155d49c1c6fabc3ae.tar.gz CMake-09421a261c188763d3acfc7155d49c1c6fabc3ae.tar.bz2 |
ENH: Preserve permissions when copying files
Diffstat (limited to 'Source/cmSystemTools.cxx')
-rw-r--r-- | Source/cmSystemTools.cxx | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx index dae4124..e3a9028 100644 --- a/Source/cmSystemTools.cxx +++ b/Source/cmSystemTools.cxx @@ -810,7 +810,19 @@ bool cmSystemTools::DoesFileExistWithExtensions( bool cmSystemTools::cmCopyFile(const char* source, const char* destination) { - return Superclass::CopyFileAlways(source, destination); + mode_t perm = 0; + return cmSystemTools::GetPermissions(source, perm) && + Superclass::CopyFileAlways(source, destination) && + cmSystemTools::SetPermissions(destination, perm); +} + +bool cmSystemTools::CopyFileIfDifferent(const char* source, + const char* destination) +{ + mode_t perm = 0; + return cmSystemTools::GetPermissions(source, perm) && + Superclass::CopyFileIfDifferent(source, destination) && + cmSystemTools::SetPermissions(destination, perm); } void cmSystemTools::Glob(const char *directory, const char *regexp, |