summaryrefslogtreecommitdiff
path: root/libs/audiographer
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2016-02-14 13:23:45 +0100
committerRobin Gareus <robin@gareus.org>2016-02-14 13:23:45 +0100
commitf23bb163a8e1aa7fdd01d5c585822f52609b2d88 (patch)
tree18c76347122194eae0397c1f8b16588e2a571b01 /libs/audiographer
parent0034ecfe49de01df80fad14d93efb0cc6084d7a8 (diff)
Ensure export starts with a clean state
Diffstat (limited to 'libs/audiographer')
-rw-r--r--libs/audiographer/private/sndfile.hh6
1 files changed, 6 insertions, 0 deletions
diff --git a/libs/audiographer/private/sndfile.hh b/libs/audiographer/private/sndfile.hh
index 8b7e1928e4..3093d3ebda 100644
--- a/libs/audiographer/private/sndfile.hh
+++ b/libs/audiographer/private/sndfile.hh
@@ -193,6 +193,9 @@ SndfileHandle::SndfileHandle (const char *path, int mode, int fmt, int chans, in
if (mode & SFM_WRITE) {
writable = true;
}
+ if (writable) {
+ ::g_unlink (path);
+ }
#ifdef PLATFORM_WINDOWS
int fd = g_open (path, writable ? O_CREAT | O_RDWR : O_RDONLY, writable ? 0644 : 0444);
#else
@@ -225,6 +228,9 @@ SndfileHandle::SndfileHandle (std::string const & path, int mode, int fmt, int c
if (mode & SFM_WRITE) {
writable = true;
}
+ if (writable) {
+ ::g_unlink (path.c_str());
+ }
#ifdef PLATFORM_WINDOWS
int fd = g_open (path.c_str(), writable ? O_CREAT | O_RDWR : O_RDONLY, writable ? 0644 : 0444);
#else