From 375a6a880323ca2d44bddeefb9d1eb7f0f74ace9 Mon Sep 17 00:00:00 2001 From: Leland Lucius Date: Sun, 3 Jan 2021 16:02:43 -0600 Subject: [PATCH] Bug 2604 - Saving a 4 hour stereo chirp to FAT fails and with an inappropriate error message --- src/ProjectFileManager.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/ProjectFileManager.cpp b/src/ProjectFileManager.cpp index 54b4cd874..43dc21c14 100644 --- a/src/ProjectFileManager.cpp +++ b/src/ProjectFileManager.cpp @@ -299,6 +299,20 @@ bool ProjectFileManager::DoSave(const FilePath & fileName, const bool fromSaveAs return false; } + if (FileNames::IsOnFATFileSystem(fileName)) + { + if (wxFileName::GetSize(projectFileIO.GetFileName()) > UINT32_MAX) + { + ShowErrorDialog( + &window, + XO("Error Saving Project"), + XO("The project exceeds the maximum size of 4GB when writing to a FAT32 formatted filesystem."), + "Error:_Unsuitable_drive#fat32" + ); + return false; + } + } + bool success = projectFileIO.SaveProject(fileName, mLastSavedTracks.get()); if (!success) {