From f23bb163a8e1aa7fdd01d5c585822f52609b2d88 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Sun, 14 Feb 2016 13:23:45 +0100 Subject: Ensure export starts with a clean state --- libs/audiographer/private/sndfile.hh | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'libs/audiographer') 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 -- cgit v1.2.3