From 98e00c92ad90bfe35e951a67bbb310d285c5cf5b Mon Sep 17 00:00:00 2001 From: Leland Lucius Date: Mon, 11 Jan 2021 13:12:59 -0600 Subject: [PATCH] Detect temp dir FAT drive change while Audacity is active --- src/FileNames.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/FileNames.cpp b/src/FileNames.cpp index 14a775afa..61e9d92b2 100644 --- a/src/FileNames.cpp +++ b/src/FileNames.cpp @@ -213,6 +213,21 @@ wxString FileNames::TempDir() if (gPrefs && path.empty()) path = gPrefs->Read(PreferenceKey(Operation::Temp, PathType::_None), wxT("")); + + if (IsOnFATFileSystem(path)) + { + ShowErrorDialog( + nullptr, + XO("Unsuitable"), + XO("The temporary files direcotory is on a FAT formatted drive\n" + "Resetting to default location."), + "Error:_Unsuitable_drive" + ); + + path = DefaultTempDir(); + UpdateDefaultPath(FileNames::Operation::Temp, path); + } + return FileNames::MkDir(path); }