authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2019-10-16 18:13:40-04:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2019-10-16 18:13:40-04:00
log09abd09ab85189b15c3296407a5a8a803e93ebd0
tree57f6eecb5c6e5f9a8ca45ae5c69e2e9cabc6a6ac
parent6a549a7f0cc337634c5dca6abf20eca53b572f21
signaturelock-open Commit is signed but in an unrecognized format.

add docs for std.fs.File.updateTimes


1 files changed, 11 insertions(+), 3 deletions(-)

lib/std/fs/file.zig+11-3
...@@ -269,9 +269,17 @@ pub const File = struct {...@@ -269,9 +269,17 @@ pub const File = struct {
269269
270 pub const UpdateTimesError = os.FutimensError || windows.SetFileTimeError;270 pub const UpdateTimesError = os.FutimensError || windows.SetFileTimeError;
271271
272 /// `atime`: access timestamp in nanoseconds272 /// The underlying file system may have a different granularity than nanoseconds,
273 /// `mtime`: last modification timestamp in nanoseconds273 /// and therefore this function cannot guarantee any precision will be stored.
274 pub fn updateTimes(self: File, atime: i64, mtime: i64) UpdateTimesError!void {274 /// Further, the maximum value is limited by the system ABI. When a value is provided
275 /// that exceeds this range, the value is clamped to the maximum.
276 pub fn updateTimes(
277 self: File,
278 /// access timestamp in nanoseconds
279 atime: i64,
280 /// last modification timestamp in nanoseconds
281 mtime: i64,
282 ) UpdateTimesError!void {
275 if (windows.is_the_target) {283 if (windows.is_the_target) {
276 const atime_ft = windows.nanoSecondsToFileTime(atime);284 const atime_ft = windows.nanoSecondsToFileTime(atime);
277 const mtime_ft = windows.nanoSecondsToFileTime(mtime);285 const mtime_ft = windows.nanoSecondsToFileTime(mtime);