c - Is write/fwrite guaranteed to be sequential? -
is data written via write
(or fwrite
) guaranteed persisted disk in sequence manner? in particular in relation fault tolerance. if system should fail during write, behave though first bytes written first , writing stopped mid-stream (as opposed random blocks written).
also, sequential calls write
/fwrite
guaranteed sequential? according posix find call read
guaranteed consider previous write
.
i'm asking i'm creating fault tolerant data store persists disks. logical order of writing such faults won't ruin data, if logical order isn't being obeyed have problem.
note: i'm not asking if persistence guaranteed. if calls write persist obey order in write.
the posix docs write()
state "if o_dsync bit has been set, write i/o operations on file descriptor shall complete defined synchronized i/o data integrity completion". presumably, if o_dsync
bit isn't set, synchronization of i/o data integrity completion unspecified. posix says "this volume of posix.1-2008 silent effects of application-level caching (such done stdio)", think there no guarantee fwrite()
.
Comments
Post a Comment