From 57ac916ccd6c923c9dae7b6ae5be5886e0fbc440 Mon Sep 17 00:00:00 2001 From: Bill Sideris Date: Sun, 27 Aug 2023 23:29:08 +0300 Subject: [PATCH 1/2] .Trash-1000 on filesystem creation --- supervisor/shared/filesystem.c | 1 + 1 file changed, 1 insertion(+) diff --git a/supervisor/shared/filesystem.c b/supervisor/shared/filesystem.c index 345f55f2f1..d70505531b 100644 --- a/supervisor/shared/filesystem.c +++ b/supervisor/shared/filesystem.c @@ -129,6 +129,7 @@ bool filesystem_init(bool create_allowed, bool force_create) { } make_empty_file(&vfs_fat->fatfs, "/.metadata_never_index"); make_empty_file(&vfs_fat->fatfs, "/.Trashes"); + make_empty_file(&vfs_fat->fatfs, "/.Trash-1000"); make_empty_file(&vfs_fat->fatfs, "/.fseventsd/no_log"); #if CIRCUITPY_OS_GETENV make_empty_file(&vfs_fat->fatfs, "/settings.toml"); From 029c912bf0f19062426922962deaf12d9785c5bc Mon Sep 17 00:00:00 2001 From: Bill Sideris Date: Mon, 28 Aug 2023 17:03:32 +0300 Subject: [PATCH 2/2] Comment and reorder the files creation. --- supervisor/shared/filesystem.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/supervisor/shared/filesystem.c b/supervisor/shared/filesystem.c index d70505531b..f6ade7cbba 100644 --- a/supervisor/shared/filesystem.c +++ b/supervisor/shared/filesystem.c @@ -127,10 +127,15 @@ bool filesystem_init(bool create_allowed, bool force_create) { if (res != FR_OK) { return false; } - make_empty_file(&vfs_fat->fatfs, "/.metadata_never_index"); - make_empty_file(&vfs_fat->fatfs, "/.Trashes"); - make_empty_file(&vfs_fat->fatfs, "/.Trash-1000"); make_empty_file(&vfs_fat->fatfs, "/.fseventsd/no_log"); + make_empty_file(&vfs_fat->fatfs, "/.metadata_never_index"); + + // Prevent storing trash on all OSes. + make_empty_file(&vfs_fat->fatfs, "/.Trashes"); // MacOS + make_empty_file(&vfs_fat->fatfs, "/.Trash-1000"); // Linux, XDG trash spec: + // https://specifications.freedesktop.org/trash-spec/trashspec-latest.html + + #if CIRCUITPY_OS_GETENV make_empty_file(&vfs_fat->fatfs, "/settings.toml"); #endif