Skip to content

Commit

Permalink
Remove sym. link before creating a new one
Browse files Browse the repository at this point in the history
  • Loading branch information
martin-steinegger committed May 4, 2019
1 parent 0218156 commit d36dea2
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/commons/FileUtil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,9 @@ void FileUtil::symlinkAlias(const std::string &file, const std::string &alias) {
}

void FileUtil::symlinkAbs(const std::string &target, const std::string &link) {
if(FileUtil::fileExists(link.c_str())){
FileUtil::remove(link.c_str());
}
char *t = realpath(target.c_str(), NULL);
if (t == NULL) {
Debug(Debug::ERROR) << "Could not get realpath of " << target << "!\n";
Expand Down

0 comments on commit d36dea2

Please sign in to comment.