Skip to content

Instantly share code, notes, and snippets.

@felipeborges
Last active August 29, 2015 14:01
Show Gist options
  • Save felipeborges/52d1abb30c246c73c6d1 to your computer and use it in GitHub Desktop.
Save felipeborges/52d1abb30c246c73c6d1 to your computer and use it in GitHub Desktop.
Bug in GFile.replace_contents_async
const ByteArray = imports.byteArray;
const Gio = imports.gi.Gio;
const Lang = imports.lang;
const Mainloop = imports.mainloop;
let byteArray = ByteArray.fromString('lala');;
let file = Gio.file_new_for_path("output.json");
file.replace_contents_async(byteArray, null, false, Gio.FileCreateFlags.REPLACE_DESTINATION, null,
Lang.bind(this, function() {
log("bye!");
}));
Mainloop.run();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment