Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

/.Trash-1000 on filesystem creation. #8339

Merged
merged 2 commits into from
Aug 28, 2023
Merged

/.Trash-1000 on filesystem creation. #8339

merged 2 commits into from
Aug 28, 2023

Conversation

bill88t
Copy link

@bill88t bill88t commented Aug 27, 2023

This ensures that on linux no .Trash-1000 folder is created, storing deleted files.
The files will instead be sent to ~/.local/Trash.

This only covers deletions made by the user which has the uid 1000, but that's the default user uid.
Unless you are having many users on your system and you are a secondary user, you should have uid 1000.
It's not perfect, but better than not having it there.

@dhalbert
Copy link
Collaborator

We thought we were fixing this in the past by creating the .Trashes file (not folder) when CIRCUITPY is freshly formatted, as you can see in the source. So, I'm guessing that stopped working at some point?

@jepler
Copy link
Member

jepler commented Aug 27, 2023

".Trashes" may be for some other operating system or environment, or it might be an outdated Linux usage. I wasn't able to establish for what OS this line was added. (some search excerpts seem to indicate it could have been MacOS)

Things that follow xdg specifications, which many Linux DEs try to do, use $topdir/.Trash-$uid, where $topdir is the mounting location of a filesystem (e.g., /users/<name>/CIRCUITPY). There's also a discussion of $topdir/.Trash/$uid but that likely doesn't apply since the FAT filesystem does not support the "sticky bit" of directory premissions.

XDG trash specification: https://specifications.freedesktop.org/trash-spec/trashspec-latest.html

@dhalbert
Copy link
Collaborator

dhalbert commented Aug 27, 2023

.Trashes appears to be for secondary external drives on macOS, and contains folders for .Trash-1000, etc. Search on this page for more info: http://www.thexlab.com/faqs/trash.html. Whether this is still true is an open question.

@bill88t
Copy link
Author

bill88t commented Aug 27, 2023

All I am saying is that KDE doesn't care at all about .Trashes. Like, at all.
I don't know much on the topic though.

I think it would be best to leave .Trashes alone, since this kind of an issue is not gonna be found easily (since it's all dotfiles).

@jepler
Copy link
Member

jepler commented Aug 28, 2023

I am feeling like we need to comment these with whatever environment type they're for. Otherwise, we're left scratching our heads later.

Would you be willing to add a simple 1-liner comment that this is for Linux & a link to the xdg standards document I found related to this?

thanks!

@deshipu
Copy link

deshipu commented Aug 28, 2023

What about users who have a different uid than 1000?

@bill88t
Copy link
Author

bill88t commented Aug 28, 2023

Would you be willing to add a simple 1-liner comment

Sure thing. Should I also add a note about MacOS and .Trashes? (why did I even ask?)

What about users who have a different uid than 1000?

I mean, >90% will have uid 1000.
If I add 1001 that will be probably >98%. But still..
We can keep adding more, but then we will make a million dotfiles.
The possible user uid's are 1000-65k iirc.
(And 0-999 are the root and the other system users.)

There isn't a solution that covers all uids to my knowledge.

@bill88t
Copy link
Author

bill88t commented Aug 28, 2023

Tidied it up a bit, moving the indexing stuff in one spot and the trash in another, along with adding the comments.

Copy link
Member

@jepler jepler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks!

@tannewt tannewt merged commit 74066ef into adafruit:main Aug 28, 2023
@bill88t bill88t deleted the untrash branch August 29, 2023 14:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants