Example: Delete a file, sync

public static int main (string[] args) {
// Delete my-test.txt:
File file = File.new_for_path ("my-test.txt");
try {
file.delete ();
} catch (Error e) {
print ("Error: %s\n", e.message);
}

return 0;
}

 valac --pkg gio-2.0 GLib.File.delete.vala

See:




2022 vala-language.org