Skip to content

Commit

Permalink
Hide hidden and system files/folders
Browse files Browse the repository at this point in the history
  • Loading branch information
KimJorgensen committed Jan 1, 2024
1 parent 5156884 commit ce666dd
Showing 1 changed file with 14 additions and 9 deletions.
23 changes: 14 additions & 9 deletions firmware/filesystem.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2019-2023 Kim Jørgensen
* Copyright (c) 2019-2024 Kim Jørgensen
*
* This software is provided 'as-is', without any express or implied
* warranty. In no event will the authors be held liable for any damages
Expand Down Expand Up @@ -226,21 +226,26 @@ static bool dir_open(DIR_t *dir, const char *pattern)
static bool dir_read(DIR_t *dir, FILINFO *file_info)
{
FRESULT res;
do
while (true)
{
res = f_findnext(dir, file_info);
if (res != FR_OK)
{
err("f_findnext failed (%u)", res);
break;
}

// Ignore dot files
if (file_info->fname[0] != '.')
if (!file_info->fname[0])
{
break;
}
}
while (res == FR_OK);

if (res != FR_OK)
{
err("f_findnext failed (%u)", res);
// Ignore hidden files
if (file_info->fname[0] != '.' &&
!(file_info->fattrib & (AM_HID|AM_SYS)))
{
break;
}
}

led_on();
Expand Down

0 comments on commit ce666dd

Please sign in to comment.