| ... | @@ -315,11 +315,11 @@ pub const Stat = struct { | ... | @@ -315,11 +315,11 @@ pub const Stat = struct { |
| 315 | mode: Mode, | 315 | mode: Mode, |
| 316 | kind: Kind, | 316 | kind: Kind, |
| 317 | | 317 | |
| 318 | /// Access time in nanoseconds, relative to UTC 1970-01-01. | 318 | /// Last access time in nanoseconds, relative to UTC 1970-01-01. |
| 319 | atime: i128, | 319 | atime: i128, |
| 320 | /// Last modification time in nanoseconds, relative to UTC 1970-01-01. | 320 | /// Last modification time in nanoseconds, relative to UTC 1970-01-01. |
| 321 | mtime: i128, | 321 | mtime: i128, |
| 322 | /// Creation time in nanoseconds, relative to UTC 1970-01-01. | 322 | /// Last status/metadata change time in nanoseconds, relative to UTC 1970-01-01. |
| 323 | ctime: i128, | 323 | ctime: i128, |
| 324 | | 324 | |
| 325 | pub fn fromSystem(st: posix.system.Stat) Stat { | 325 | pub fn fromSystem(st: posix.system.Stat) Stat { |
| ... | @@ -369,6 +369,8 @@ pub const Stat = struct { | ... | @@ -369,6 +369,8 @@ pub const Stat = struct { |
| 369 | | 369 | |
| 370 | pub const StatError = posix.FStatError; | 370 | pub const StatError = posix.FStatError; |
| 371 | | 371 | |
| | 372 | /// Returns `Stat` containing basic information about the `File`. |
| | 373 | /// Use `metadata` to retrieve more detailed information (e.g. creation time, permissions). |
| 372 | /// TODO: integrate with async I/O | 374 | /// TODO: integrate with async I/O |
| 373 | pub fn stat(self: File) StatError!Stat { | 375 | pub fn stat(self: File) StatError!Stat { |
| 374 | if (builtin.os.tag == .windows) { | 376 | if (builtin.os.tag == .windows) { |
| ... | @@ -392,7 +394,7 @@ pub fn stat(self: File) StatError!Stat { | ... | @@ -392,7 +394,7 @@ pub fn stat(self: File) StatError!Stat { |
| 392 | .kind = if (info.StandardInformation.Directory == 0) .file else .directory, | 394 | .kind = if (info.StandardInformation.Directory == 0) .file else .directory, |
| 393 | .atime = windows.fromSysTime(info.BasicInformation.LastAccessTime), | 395 | .atime = windows.fromSysTime(info.BasicInformation.LastAccessTime), |
| 394 | .mtime = windows.fromSysTime(info.BasicInformation.LastWriteTime), | 396 | .mtime = windows.fromSysTime(info.BasicInformation.LastWriteTime), |
| 395 | .ctime = windows.fromSysTime(info.BasicInformation.CreationTime), | 397 | .ctime = windows.fromSysTime(info.BasicInformation.ChangeTime), |
| 396 | }; | 398 | }; |
| 397 | } | 399 | } |
| 398 | | 400 | |