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 {
269269
270270 pub const UpdateTimesError = os.FutimensError || windows.SetFileTimeError;
271271
272 /// `atime`: access timestamp in nanoseconds
273 /// `mtime`: last modification timestamp in nanoseconds
274 pub fn updateTimes(self: File, atime: i64, mtime: i64) UpdateTimesError!void {
272 /// The underlying file system may have a different granularity than nanoseconds,
273 /// and therefore this function cannot guarantee any precision will be stored.
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 {
275283 if (windows.is_the_target) {
276284 const atime_ft = windows.nanoSecondsToFileTime(atime);
277285 const mtime_ft = windows.nanoSecondsToFileTime(mtime);