Fix Windows file time conversion (from FILETIME to unix time) - #608
Conversation
There was a problem hiding this comment.
Pull request overview
Fixes Windows timestamp handling by converting NTFS FILETIME (100ns ticks since 1601) into Unix epoch seconds before those values are used for filtering and for chrono-based formatting, preventing incorrect time behavior on Windows.
Changes:
- Added a Windows-only
FILETIME -> Unix secondsconversion helper and applied it to all Windows metadata time reads. - Added Windows-only integration tests covering
--filetime modifiedoutput and--mtimefiltering behavior.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| tests/test_flags.rs | Adds Windows-specific integration tests for --filetime and --mtime. |
| src/platform.rs | Converts Windows metadata timestamps from FILETIME to Unix epoch seconds before returning them. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
Hi yes I remember you. In advance I'm not reliably online so I apologise in advance if I don't reply. It would be good to have someone looking after the windows build - because I don't have a windows box myself. |
|
i think your reasoning is ok but the tests currently fail. I think the copilot review comments are worth looking at. |
|
@bootandy I've fixed the failing tests and addressed the copilot feedback When you may have a chance, could you please approve the workflow so CI can run again? |
Hi Andy! I'm Adithya, I met you on Thursday earlier this week
I wanted to practice contributing to some open source projects like you suggested, and I thought I'd start by contributing to
dust!This PR fixes the following:
get_pretty_file_modified_timein display.rs and here chrono will expect unix timeCorrection: