Skip to content
  • Will Thompson's avatar
    gfileutils: document non-atomicity of g_file_set_contents() · c1a8e93d
    Will Thompson authored and Will Thompson's avatar Will Thompson committed
    This function only calls fsync() if @target exists and is non-empty. If
    not, it doesn't provide the "old contents or new contents" guarantee
    that one might expect. This has been the case since
    d20a188b, and is justified either as a
    performance optimization or by asserting that this function only
    guarantees to not destroy existing data (implicitly defining
    non-existence or emptiness as not data).
    
    In addition, explicitly spell out that whether it's atomic in the
    non-empty case is system-dependent. If the system administrator has
    configured some funky filesystem options, they may be out of luck on the
    atomicity front.
    
    #1302
    c1a8e93d