On this page
  1. posix.fsync
  2. Import
  3. Signature & Overview
  4. Usage
  5. Gotchas
  6. REPL Inspect

posix.fsync

Prev: posix.fstatvfs | Up: posix | Next: posix.ftruncate
Rel: posix.abort, posix.access, posix.chdir, posix.chflags
Ref: docs.python.org — posix.fsync
Tags: #public #python3 #stdlib #posix


Import

import posix
from posix import fsync

Signature & Overview

posix.fsync(fd)

Force write of fd to disk.

Usage

import os, tempfile

with tempfile.TemporaryFile('w+b') as f:
    f.write(b'durable')
    f.flush()
    os.fsync(f.fileno())

Gotchas

REPL Inspect

from posix import fsync
help(fsync)

Linked from

Related notes