}
this.projects = [];
- var gdir = GLib.dir_open(this.dirname,0);
- while (true) {
-
- var fn = gdir.read_name();
- if (!fn) {
- gdir.close();
- break;
- }
+ var files = File.list(this.dirname);
+ for (var i =0 ; i < files.length;i++) {
+ var fn = files[i];
+
if (!fn.match(/.json$/)) {
continue;
}
Seed.print(p.fn);
}
-
-
- var file = Gio.file_new_for_path(_this.dirname + '/' + p.fn + '.json');
-
- var stream = file.replace(null,false,0);
- //console.dump(p);
var s = p.toJSON();
- stream.write(s, s.length);
- stream.close();
+ File.write(_this.dirname + '/' + p.fn + '.json', s);
});