The offending source code is: https://github.com/ziglang/zig/blob/779b8e2/lib/std/fs/File.zig#L373.
Note that I'm not an expert of Windows, however I think that the following issue should be fixed:
Using info.BasicInformation.CreationTime as ctime
In POSIX, ctime represent file metadata change. The equivalent of POSIX ctime is info.BasicInformation.ChangetimeTime, not CreationTime.
See https://devblogs.microsoft.com/oldnewthing/20100709-00/?p=13463 for an unofficial reference.
Supporting only kind of type .file or `.directory
Windows supports symbolic links in info.BasicInformation.FileAttributes and in info.StandardInformation.NumberOfLinks.
Zig should support them, if the semantic is compatible with POSIX.
Add birthtime to std.fs.File.Stat
Since Windows and some POSIX systems like Linux (ext4 and btrfs), BSD (ufs2) and Solaris (zfs) supports birthtime, Zig should add an optional birthtime field to Stat.
Thanks
The offending source code is: https://github.com/ziglang/zig/blob/779b8e2/lib/std/fs/File.zig#L373.
Note that I'm not an expert of Windows, however I think that the following issue should be fixed:
Using
info.BasicInformation.CreationTimeasctimeIn POSIX,
ctimerepresent file metadata change. The equivalent of POSIXctimeisinfo.BasicInformation.ChangetimeTime, notCreationTime.See https://devblogs.microsoft.com/oldnewthing/20100709-00/?p=13463 for an unofficial reference.
Supporting only
kindof type.fileor `.directoryWindows supports symbolic links in
info.BasicInformation.FileAttributesand ininfo.StandardInformation.NumberOfLinks.Zig should support them, if the semantic is compatible with POSIX.
Add birthtime to
std.fs.File.StatSince Windows and some POSIX systems like Linux (ext4 and btrfs), BSD (ufs2) and Solaris (zfs) supports birthtime, Zig should add an optional
birthtimefield toStat.Thanks