toFile overloads

Synopses

Declared in <folly/gen/File.h>

Sink that writes to a file with a buffer of the given size. If bufferSize is 0, writes will be unbuffered.

template<class S = /* implementation-defined */::FileWriter>
S
toFile(
    File file,
    size_t bufferSize = 4096);

Sink that writes to a file using a given buffer. If the buffer is nullptr, writes will be unbuffered.

template<class S = /* implementation-defined */::FileWriter>
S
toFile(
    File file,
    std::unique_ptr<IOBuf> buffer);

Return Value

A sink that writes values to the file.

Parameters

Name

Description

file

The file to write to.

bufferSize

The size of the write buffer in bytes; 0 means unbuffered.

buffer

The buffer used to batch writes, or nullptr for unbuffered.

Created with MrDocs