writeFileAtomic overloads

Synopses

Declared in <folly/FileUtil.h>

Atomically writes a string to a file using the given options.

void
writeFileAtomic(
    StringPiece filePath,
    StringPiece data,
    WriteFileAtomicOptions const& options);

Atomically writes a byte range to a file.

void
writeFileAtomic(
    StringPiece filePath,
    ByteRange data,
    mode_t permissions = 0644,
    SyncType syncType = SyncType::WITHOUT_SYNC);

Atomically writes a string to a file.

void
writeFileAtomic(
    StringPiece filePath,
    StringPiece data,
    mode_t permissions = 0644,
    SyncType syncType = SyncType::WITHOUT_SYNC);

Write file contents "atomically".

void
writeFileAtomic(
    StringPiece filePath,
    iovec* iov,
    int count,
    mode_t permissions = 0644,
    SyncType syncType = SyncType::WITHOUT_SYNC);

Parameters

Name

Description

filePath

Destination path to write.

data

The data to write.

options

Options controlling permissions, sync, and temp directory.

permissions

Permission bits used for the file.

syncType

Whether to sync the data to storage before the rename.

iov

Array of buffers holding the data to write.

count

Number of entries in iov.

Created with MrDocs