Zig 0.17.0-dev (Split by item)

Shortcut keys
?
Show these tips
S
Focus search field
Esc
Clear focus & close tips
U
Jump to source code
↑
Move up in search results
↓
Move down in search results
↵
Go to active search result
This is an example of documentation generated by ZigDoc, an alternative to Zig's built-in Auto Doc feature. See also examples in other modes/formats. The project being documented here (as the example) is the Zig standard library. Private Function

testGetCurrentFileTimestamp

Private Function
std.Build.Cache.testGetCurrentFileTimestamp
fn testGetCurrentFileTimestamp(io: Io, dir: Io.Dir) !Io.Timestamp

Create/Write a file, close it, then grab its stat.mtime timestamp.

Params

File

Build/Cache.zig:1323
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
fn testGetCurrentFileTimestamp(io: Io, dir: Io.Dir) !Io.Timestamp {
    const test_out_file = "test-filetimestamp.tmp";

    var file = try dir.createFile(io, test_out_file, .{
        .read = true,
        .truncate = true,
    });
    defer {
        file.close(io);
        dir.deleteFile(io, test_out_file) catch {};
    }

    return (try file.stat(io)).mtime;
}