| ... | @@ -200,6 +200,17 @@ pub const File = struct { | ... | @@ -200,6 +200,17 @@ pub const File = struct { |
| 200 | } | 200 | } |
| 201 | } | 201 | } |
| 202 | | 202 | |
| | 203 | pub const SyncError = os.SyncError; |
| | 204 | |
| | 205 | /// Blocks until all pending file contents and metadata modifications |
| | 206 | /// for the file have been synchronized with the underlying filesystem. |
| | 207 | /// |
| | 208 | /// Note that this does not ensure that metadata for the |
| | 209 | /// directory containing the file has also reached disk. |
| | 210 | pub fn sync(self: File) SyncError!void { |
| | 211 | return os.fsync(self.handle); |
| | 212 | } |
| | 213 | |
| 203 | /// Test whether the file refers to a terminal. | 214 | /// Test whether the file refers to a terminal. |
| 204 | /// See also `supportsAnsiEscapeCodes`. | 215 | /// See also `supportsAnsiEscapeCodes`. |
| 205 | pub fn isTty(self: File) bool { | 216 | pub fn isTty(self: File) bool { |