mirror of
https://github.com/ziglang/zig.git
synced 2026-02-12 20:37:54 +00:00
add docs for std.fs.File.updateTimes
This commit is contained in:
parent
6a549a7f0c
commit
09abd09ab8
@ -269,9 +269,17 @@ pub const File = struct {
|
||||
|
||||
pub const UpdateTimesError = os.FutimensError || windows.SetFileTimeError;
|
||||
|
||||
/// `atime`: access timestamp in nanoseconds
|
||||
/// `mtime`: last modification timestamp in nanoseconds
|
||||
pub fn updateTimes(self: File, atime: i64, mtime: i64) UpdateTimesError!void {
|
||||
/// The underlying file system may have a different granularity than nanoseconds,
|
||||
/// and therefore this function cannot guarantee any precision will be stored.
|
||||
/// Further, the maximum value is limited by the system ABI. When a value is provided
|
||||
/// that exceeds this range, the value is clamped to the maximum.
|
||||
pub fn updateTimes(
|
||||
self: File,
|
||||
/// access timestamp in nanoseconds
|
||||
atime: i64,
|
||||
/// last modification timestamp in nanoseconds
|
||||
mtime: i64,
|
||||
) UpdateTimesError!void {
|
||||
if (windows.is_the_target) {
|
||||
const atime_ft = windows.nanoSecondsToFileTime(atime);
|
||||
const mtime_ft = windows.nanoSecondsToFileTime(mtime);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user