Skip to content

Commit 74066ef

Browse files
authored
Merge pull request #8339 from bill88t/untrash
`/.Trash-1000` on filesystem creation.
2 parents c395e1f + 029c912 commit 74066ef

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

supervisor/shared/filesystem.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,9 +127,15 @@ bool filesystem_init(bool create_allowed, bool force_create) {
127127
if (res != FR_OK) {
128128
return false;
129129
}
130-
make_empty_file(&vfs_fat->fatfs, "/.metadata_never_index");
131-
make_empty_file(&vfs_fat->fatfs, "/.Trashes");
132130
make_empty_file(&vfs_fat->fatfs, "/.fseventsd/no_log");
131+
make_empty_file(&vfs_fat->fatfs, "/.metadata_never_index");
132+
133+
// Prevent storing trash on all OSes.
134+
make_empty_file(&vfs_fat->fatfs, "/.Trashes"); // MacOS
135+
make_empty_file(&vfs_fat->fatfs, "/.Trash-1000"); // Linux, XDG trash spec:
136+
// https://specifications.freedesktop.org/trash-spec/trashspec-latest.html
137+
138+
133139
#if CIRCUITPY_OS_GETENV
134140
make_empty_file(&vfs_fat->fatfs, "/settings.toml");
135141
#endif

0 commit comments

Comments
 (0)