summaryrefslogtreecommitdiff
path: root/libs/ardour/audiofilesource.cc
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2006-08-02 00:22:16 +0000
committerDavid Robillard <d@drobilla.net>2006-08-02 00:22:16 +0000
commite51e31dca20d1e636508c61d93a740fdb48eeebd (patch)
tree647ea489c56feb6c1c7611c6cdb1e025f6f7fbb0 /libs/ardour/audiofilesource.cc
parent0565c75ce8344ecd2e4b42edeabc9cace5f3c091 (diff)
Merged from trunk R743
git-svn-id: svn://localhost/ardour2/branches/midi@744 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/audiofilesource.cc')
-rw-r--r--libs/ardour/audiofilesource.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/libs/ardour/audiofilesource.cc b/libs/ardour/audiofilesource.cc
index b3b672713f..46079ef9a5 100644
--- a/libs/ardour/audiofilesource.cc
+++ b/libs/ardour/audiofilesource.cc
@@ -618,6 +618,12 @@ AudioFileSource::set_name (string newname, bool destructive)
return -1;
}
+ // Test whether newpath exists, if yes notify the user but continue.
+ if (access(newpath.c_str(),F_OK) == 0) {
+ error << _("Programming error! Ardour tried to rename a file over another file! It's safe to continue working, but please report this to the developers.") << endmsg;
+ return -1;
+ }
+
if (rename (oldpath.c_str(), newpath.c_str()) != 0) {
error << string_compose (_("cannot rename audio file for %1 to %2"), _name, newpath) << endmsg;
return -1;