Skip to content

Commit

Permalink
Merge branch '347-avertissement-le-fichier-xyz-existe' into 'main'
Browse files Browse the repository at this point in the history
fix: rename fails on windows if destination file exists

Closes #347

See merge request travaux-speciaux-sgn/comp3d_cpp!52
  • Loading branch information
jmmuller committed Jul 18, 2024
2 parents a314316 + 60cde1e commit fee51d8
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/uni_stream.h
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,7 @@ namespace uni_stream {

inline int rename_file(const std::string& old_name, const std::string& new_name)
{
::remove(new_name.c_str());
return ::rename(old_name.c_str(),new_name.c_str()) < 0 ? errno : 0;
}

Expand Down

0 comments on commit fee51d8

Please sign in to comment.