Function sync [src]

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.

Prototype

pub fn sync(self: File) SyncError!void

Parameters

self: File

Possible Errors

AccessDenied SyncError
DiskQuota SyncError
InputOutput SyncError
NoSpaceLeft SyncError
Unexpected UnexpectedError

The Operating System returned an undocumented error code.

This error is in theory not possible, but it would be better to handle this error than to invoke undefined behavior.

When this error code is observed, it usually means the Zig Standard Library needs a small patch to add the error code to the error set for the respective function.

Source

pub fn sync(self: File) SyncError!void { return posix.fsync(self.handle); }