[wpiutil] DataLog: Stop logging if insufficient free space (#5699)

The threshold is set to 5 MB.
This commit is contained in:
Peter Johnson
2023-10-01 14:01:49 -07:00
committed by GitHub
parent 48facb9cef
commit 8d2cbfce16
2 changed files with 75 additions and 27 deletions

View File

@@ -111,7 +111,7 @@ Thread::~Thread() {
void Thread::Main() {
// based on free disk space, scan for "old" FRC_*.wpilog files and remove
{
uintmax_t freeSpace = fs::space(m_logDir).free;
uintmax_t freeSpace = fs::space(m_logDir).available;
if (freeSpace < kFreeSpaceThreshold) {
// Delete oldest FRC_*.wpilog files (ignore FRC_TBD_*.wpilog as we just
// created one)