mirror of
https://github.com/ziglang/zig.git
synced 2026-02-18 07:18:38 +00:00
Add std.fs.File.sync (#11410)
This commit is contained in:
parent
d2681d2537
commit
988afd51cd
@ -200,6 +200,17 @@ pub const File = struct {
|
||||
}
|
||||
}
|
||||
|
||||
pub const SyncError = os.SyncError;
|
||||
|
||||
/// Blocks until all pending file contents and metadata modifications
|
||||
/// for the file have been synchronized with the underlying filesystem.
|
||||
///
|
||||
/// Note that this does not ensure that metadata for the
|
||||
/// directory containing the file has also reached disk.
|
||||
pub fn sync(self: File) SyncError!void {
|
||||
return os.fsync(self.handle);
|
||||
}
|
||||
|
||||
/// Test whether the file refers to a terminal.
|
||||
/// See also `supportsAnsiEscapeCodes`.
|
||||
pub fn isTty(self: File) bool {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user