delete_async


Description:

[ CCode ( vfunc_name = "delete_file_async" ) ]
[ Version ( since = "2.34" ) ]
public virtual async bool delete_async (int io_priority = DEFAULT, Cancellable? cancellable = null) throws Error

Example: Delete a file, async:

public static int main (string[] args) {
MainLoop loop = new MainLoop ();

// Delete my-test.txt:
File file = File.new_for_path ("my-test.txt");
file.delete_async.begin (Priority.DEFAULT, null, (obj, res) => {
try {
bool tmp = file.delete_async.end (res);
print ("Result: %s\n", tmp.to_string ());
} catch (Error e) {
print ("Error: %s\n", e.message);
}

loop.quit ();
});

loop.run ();
return 0;
}

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