#include"script.h" // on the assumtion that file: example.txt exist in program directory int main() { Str buf; uint size = loadFile( "example.txt", buf ); // size == buf.size() Str a( "text" ); saveFile( "example.txt", a.c_str(), 1 ); // append "text" to example.txt saveFile( "example2.txt", a.c_str(), 0 ); // create example2.txt and put "text" to it }