ofDocsdocumentation utils ofFileUtils (functions)

ofFileUtils (functions)


ofBufferFromFile( ... )

ofBuffer ofBufferFromFile(const filesystem::path &path, bool binary=true)

Read the contents of a file at path into a buffer.

Opens as a text file by default.

Parameters:

path file to open

binary set to false if you are reading a text file & want lines split at endline characters automatically


ofBufferToFile( ... )

bool ofBufferToFile(const filesystem::path &path, const ofBuffer &buffer, bool binary=true)

Write the contents of a buffer to a file at path.

Saves as a text file by default.

Parameters:

path file to open

buffer data source to write from

binary set to false if you are writing a text file & want lines split at endline characters automatically