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

Parsing order in a folder #1024

Open
tototrix23 opened this issue Sep 16, 2024 · 1 comment
Open

Parsing order in a folder #1024

tototrix23 opened this issue Sep 16, 2024 · 1 comment
Labels

Comments

@tototrix23
Copy link

Hi everyone,

It's not an issue but a question. When you create hundred of files in a folder and you want to parse it:
what is the parsing order ? The oldest created file to the newest ? Is it true all the time ?

Best regards.

@geky geky added the question label Sep 17, 2024
@geky
Copy link
Member

geky commented Sep 17, 2024

Hi @tototrix23, thanks for creating an issue.

The order lfs_dir_read returns files is a bit weird. It's almost alphabetical, but with larger file names being returned first.

Originally the ordering was intended to be strictly alphabetical, but a bug in the comparison logic went unnoticed. Backwards compatible with existing disks makes this difficult to change without a minor/major on-disk version bump. More info here: #923.

Still, this ordering can be useful if you want to intentionally order files with same-sized filenames.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants