Branch: refs/heads/lkgr
Commit: 9f7bf3fcffa32ef89a8c8d4d9d8c4185c1f2324e
https://github.com/dart-lang/sdk/commit/9f7bf3fcffa32ef89a8c8d4d9d8c4185c1f2324e
Author: Sigurd Meldgaard <
sig...@google.com>
Date: 2026-06-18 (Thu, 18 Jun 2026)
Changed paths:
M runtime/bin/file.cc
M runtime/bin/file.h
M runtime/bin/file_fuchsia.cc
M runtime/bin/file_linux.cc
M runtime/bin/file_macos.cc
M runtime/bin/file_win.cc
M runtime/bin/utils_win.cc
M runtime/bin/utils_win.h
M runtime/include/dart_tools_api.h
M runtime/vm/isolate.cc
M runtime/vm/isolate_reload.cc
M sdk/lib/io/file_impl.dart
M sdk/lib/io/file_system_entity.dart
M tests/standalone/io/file_test.dart
Log Message:
-----------
[dart:io] Support microsecond-precision file timestamps
This CL upgrades the file system timestamp reading and writing APIs in `dart:io` to support full microsecond precision (matching Dart's `DateTime` capabilities), bypassing previous millisecond and second-level truncations.
Windows supports 100-nanoseconds resolution and the other systems support nanosecond resolution. But our DateTime class only has microsecond resolution.
On Windows we stop relying on _wstat64 because of the poor time behavior, so we attempt to replicate its stat behavior.
Updates Dart_FileModifiedCallback to expect microseconds as `since` argument to correspond to what now get from File::Stat. This is technically breaking for embedders, but in api marked unstable.
Tested: Added `testSetLastModifiedMicroseconds` and `testSetLastAccessedMicroseconds` test cases into the `FileTest` suite inside `file_test.dart`.
Bug:
https://github.com/dart-lang/sdk/issues/42444
Change-Id: Icb60d62dc156b014c258985546fc78bdbb926006
CoreLibraryReviewExempt: VM-only library (dart:io)
Reviewed-on:
https://dart-review.googlesource.com/c/sdk/+/507341
Reviewed-by: Slava Egorov <
veg...@google.com>
Reviewed-by: Lasse Nielsen <
l...@google.com>
Reviewed-by: Martin Kustermann <
kuste...@google.com>
Compare:
https://github.com/dart-lang/sdk/compare/17e408b71955...9f7bf3fcffa3