Add safety checks for low SD card space (#90)

* Some attempt.

* Enable some-safety-freespace-work nightlies

* Upload elf with nightly

* *Derp fixes.*

* Bye Bye testing things.

* Revert "Upload elf with nightly"

This reverts commit 303968cd78e466a3fcc010915565d8265acaa76a.

* Add safety checks to fcopy

Co-authored-by: StackZ <47382115+SuperSaiyajinStackZ@users.noreply.github.com>
This commit is contained in:
Pk11
2021-05-26 05:47:51 -05:00
committed by GitHub
parent bfecbc86af
commit baa14561eb
11 changed files with 150 additions and 110 deletions
+3
View File
@@ -25,6 +25,7 @@
*/
#include "extract.hpp"
#include "files.hpp"
#include "queueSystem.hpp"
#include "scriptUtils.hpp"
#include <archive.hpp>
@@ -65,6 +66,8 @@ Result getExtractedSize(const std::string &archivePath, const std::string &wante
}
Result extractArchive(const std::string &archivePath, const std::string &wantedFile, const std::string &outputPath) {
if (getAvailableSpace() < extractSize) return -1; // Out of space.
archive *a = archive_read_new();
archive_entry *entry;