file set contents

程式碼

void main() {
    try {
        string file = "data.txt";
        string content = "This is Test!";

        FileUtils.set_contents(file, content);

    } catch (FileError e) {
        stderr.printf("%s\n", e.message);
    }
}

Api

參考來源