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

api/system: make stat() call consistent across platforms #1864

Merged
merged 4 commits into from
Dec 4, 2024

Conversation

takase1121
Copy link
Member

Includes #1826.

This PR uses GetFileAttributesExW on Windows to get everything we need for get_file_info(), including symlink. All platforms will now have symlink and high-resolution timestamps if supported. This should help with #1862.

@Guldoman
Copy link
Member

Awesome! With this we could also scale back the autoreload workaround added in #1823.
Would checking if the decimal part of modified is not 0 be enough to determine if the filesystem supports high resolution mtime?

@takase1121
Copy link
Member Author

I am not sure but that should be enough for most use cases. There are also problems with resolution (IIRC all the platforms we are currently supporting won't have this particular issue, though I wouldn't rely on that if I definitively need to know if the system supports high resolution time.

Copy link
Member

@Guldoman Guldoman left a comment

Choose a reason for hiding this comment

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

I noticed that on non-windows it's possible for type to be nil.
We should either avoid that, or update the documentation.

src/api/system.c Outdated Show resolved Hide resolved
@takase1121
Copy link
Member Author

takase1121 commented Dec 4, 2024

I noticed that on non-windows it's possible for type to be nil.
We should either avoid that, or update the documentation.

Can you explain how this would be the case?

UPDATE: misread

@takase1121
Copy link
Member Author

I noticed that on non-windows it's possible for type to be nil. We should either avoid that, or update the documentation.

Avoid that doesn't sound good. I can update the documentation.

@Guldoman Guldoman merged commit 9b73771 into lite-xl:master Dec 4, 2024
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants