This doesn't work (nothing happens when the directory exists):
let s_dir = Gio.file_new_for_path("./S1");
try {
s_dir.make_directory(null);
} catch(e) {
if(e == Gio.IOErrorEnum.EXISTS)
print(e);
}
Use the GLib.Error.matches()
method:
let s_dir = Gio.file_new_for_path("./S1");
try {
s_dir.make_directory(null);
} catch(e) {
if (e.matches (Gio.IOErrorEnum, Gio.IOErrorEnum.EXISTS)
print(e);
}