Skip to content

FileFlush

Description

Flush any kernel-side buffering for the file. On POSIX with no user-side buffering this is a no-op success unless the platform needs an fsync (we don’t fsync today; callers that need durable writes should fsync the fd themselves). On Windows it calls FlushFileBuffers.

Success

Returns true.

Failure

Returns false.

Usage example (Cross-references)

Usage examples (Cross-references)
        }
    
        if (ok && !FileFlush(stream)) {
            LOG_ERROR("Failed to flush formatted output");
            ok = false;
    }
    
    bool FileFlush(File *f) {
        if (!FileIsValid(f)) {
            return false;
Last updated on