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