diff options
author | Bill Hoffman <bill.hoffman@kitware.com> | 2004-10-26 18:33:54 (GMT) |
---|---|---|
committer | Bill Hoffman <bill.hoffman@kitware.com> | 2004-10-26 18:33:54 (GMT) |
commit | bb316a4945f41866308f9fdf1f15c3ff3c79cb60 (patch) | |
tree | da89eec528952e602b465db7eadd48fc8a2dadfd /Source/kwsys | |
parent | 239378e4cb13d43f69fec4f87fedf80d782eb146 (diff) | |
download | CMake-bb316a4945f41866308f9fdf1f15c3ff3c79cb60.zip CMake-bb316a4945f41866308f9fdf1f15c3ff3c79cb60.tar.gz CMake-bb316a4945f41866308f9fdf1f15c3ff3c79cb60.tar.bz2 |
ENH: handle read only directories with configure file destination
Diffstat (limited to 'Source/kwsys')
-rw-r--r-- | Source/kwsys/SystemTools.cxx | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/Source/kwsys/SystemTools.cxx b/Source/kwsys/SystemTools.cxx index d15181b..d5b5b74 100644 --- a/Source/kwsys/SystemTools.cxx +++ b/Source/kwsys/SystemTools.cxx @@ -994,11 +994,12 @@ bool SystemTools::CopyFileAlways(const char* source, const char* destination) { return false; } - - if ( SystemTools::FileExists(destination) && !SystemTools::RemoveFile(destination) ) - { - return false; - } + + // try and remove the destination file so that read only destination files + // can be written to. + // If the remove fails continue so that files in read only directories + // that do not allow file removal can be modified. + SystemTools::RemoveFile(destination); #if defined(_WIN32) || defined(__CYGWIN__) kwsys_ios::ofstream fout(destination, |