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

Question about sorting order and ‘..’ #91

Open
ghost opened this issue Feb 19, 2023 · 3 comments
Open

Question about sorting order and ‘..’ #91

ghost opened this issue Feb 19, 2023 · 3 comments

Comments

@ghost
Copy link

ghost commented Feb 19, 2023

Is there any way of guaranteeing that ‘..’ is always the first option? It would greatly simplify a lot of checks in exFAT Manager, and fix a “bug” that exists in the native file manager as well.

This would be an extremely rare occurrence, but if the user has any file/folder name that starts with a character sorted before ’.’ (or less than 2E), it will be above ‘..’

@Masamune3210
Copy link

On most, if not all modern filesystems, the . and .. directories arent actually there, they are virtual and only exist as concepts inside of programs that understand them. Think of them as shortcuts, they arent actually anything, just something to help you do something else easier. If this is the case, I would assume that they are not even considered as part of the sort list and its probably safe to assume that they will always be at the top of the list

@ghost
Copy link
Author

ghost commented Feb 19, 2023

On most, if not all modern filesystems, the . and .. directories arent actually there, they are virtual and only exist as concepts inside of programs that understand them. Think of them as shortcuts, they arent actually anything, just something to help you do something else easier. If this is the case, I would assume that they are not even considered as part of the sort list and its probably safe to assume that they will always be at the top of the list

Unfortunately that isn’t the case here. If the user has a folder named (for example) !test, it will be above ’..’. 99% of the time it won’t be an issue. But I’d like to know if aldo can help fix this before I do anything else. Long story short, if this can be fixed, I can check if the current option is 1, otherwise I need to check the current option is actually ’..’ (which is more code).

@aldostools
Copy link
Owner

aldostools commented Feb 19, 2023

As that is a rare case, it can use a normal sort.

Another way is to exclude or remove .. before sort the list. Then add .. to the beginning of the linked list after sort it.

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

No branches or pull requests

2 participants