summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Mayberry <mojofunk@gmail.com>2007-09-04 09:01:31 +0000
committerTim Mayberry <mojofunk@gmail.com>2007-09-04 09:01:31 +0000
commitd7c562937679f71132e961dccc9b470403c328d6 (patch)
tree72607aef8dba4e09eef1bfe280ba10c0cac4348a
parent41ba22d2253f682861d4db15d62bdaac971ad99e (diff)
Use sys::remove instead of ::unlink in Session::remove_empty_sounds for portability
git-svn-id: svn://localhost/ardour2/trunk@2411 d708f5d6-7413-0410-9779-e7cbd77b26cf
-rw-r--r--libs/ardour/session.cc14
1 files changed, 10 insertions, 4 deletions
diff --git a/libs/ardour/session.cc b/libs/ardour/session.cc
index eab864623b..ed696446ef 100644
--- a/libs/ardour/session.cc
+++ b/libs/ardour/session.cc
@@ -3395,10 +3395,16 @@ Session::remove_empty_sounds ()
if (AudioFileSource::is_empty (*this, audio_file_path.to_string())) {
- unlink (audio_file_path.to_string().c_str());
-
- string peak_path = peak_path_from_audio_path (audio_file_path.to_string());
- unlink (peak_path.c_str());
+ try
+ {
+ sys::remove (audio_file_path);
+ const string peak_path = peak_path_from_audio_path (audio_file_path.to_string());
+ sys::remove (peak_path);
+ }
+ catch (const sys::filesystem_error& err)
+ {
+ error << err.what() << endmsg;
+ }
}
}
}