ENH: handle read only directories with configure file destination

This commit is contained in:
Bill Hoffman 2004-10-26 14:33:54 -04:00
parent 239378e4cb
commit bb316a4945
1 changed files with 6 additions and 5 deletions

View File

@ -995,10 +995,11 @@ bool SystemTools::CopyFileAlways(const char* source, const char* destination)
return false; return false;
} }
if ( SystemTools::FileExists(destination) && !SystemTools::RemoveFile(destination) ) // try and remove the destination file so that read only destination files
{ // can be written to.
return false; // 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__) #if defined(_WIN32) || defined(__CYGWIN__)
kwsys_ios::ofstream fout(destination, kwsys_ios::ofstream fout(destination,