• Jason Flinn's avatar
    writeFileAtomic optionally syncs to provide durable atomicity · a14c8b75
    Jason Flinn authored
    Summary:
    The current implementation does not guarantee atomicity on power
    failure or OS crash.  For instance, if a crash happens after writing
    the directory to storage but before writing the file data to storage,
    then a zero-byte file can result.
    
    Provide an optional parameter to sync and provide atomicity in these
    situations.
    
    Adjust comments to reflect the actual guarantees provided.
    
    Differential Revision: D19754974
    
    fbshipit-source-id: 5ddb2f3a1b9e72b523ee13937f648e0913c94c2f
    a14c8b75
FileUtil.cpp 7.5 KB