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
參考來源
- Basic Vala Samples / Reading and Writing Text File Content