Skip to content

Commit

Permalink
Only create "don't index" files if not there
Browse files Browse the repository at this point in the history
  • Loading branch information
tyeth committed Oct 11, 2024
1 parent a5f7283 commit 2c59f39
Showing 1 changed file with 22 additions and 14 deletions.
36 changes: 22 additions & 14 deletions src/provisioning/tinyusb/Wippersnapper_FS.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -158,21 +158,29 @@ bool Wippersnapper_FS::initFilesystem(bool force_format) {
eraseBootFile();

// No file indexing on macOS
wipperFatFs.mkdir("/.fseventsd/");
File32 writeFile = wipperFatFs.open("/.fseventsd/no_log", FILE_WRITE);
if (!writeFile)
return false;
writeFile.close();

writeFile = wipperFatFs.open("/.metadata_never_index", FILE_WRITE);
if (!writeFile)
return false;
writeFile.close();
if (!wipperFatFs.exists("/.fseventsd/no_log"))
{
wipperFatFs.mkdir("/.fseventsd/");
File32 writeFile = wipperFatFs.open("/.fseventsd/no_log", FILE_WRITE);
if (!writeFile)
return false;
writeFile.close();
}

writeFile = wipperFatFs.open("/.Trashes", FILE_WRITE);
if (!writeFile)
return false;
writeFile.close();
if (!wipperFatFs.exists("/.metadata_never_index"))
{
File32 writeFile = wipperFatFs.open("/.metadata_never_index", FILE_WRITE);
if (!writeFile)
return false;
writeFile.close();
}
if (!wipperFatFs.exists("/.Trashes"))
{
File32 writeFile = wipperFatFs.open("/.Trashes", FILE_WRITE);
if (!writeFile)
return false;
writeFile.close();
}

// Create wippersnapper_boot_out.txt file
if (!createBootFile())
Expand Down

0 comments on commit 2c59f39

Please sign in to comment.