Snippet. Vala. Rename a File

This small snippet shows how to rename a file in Vala.

var file = File.new_from_path("hello.txt");
var renamed = file.set_display_name ("hello_world.html");

Updated on: 25 Jan 2022