Re: [Vala] Write to file



Adding BufferedOutputStream did the trick)

var fstream = file.create (FileCreateFlags.NONE);
var dos = new DataOutputStream (new BufferedOutputStream.sized (fstream, 65536));

Wish it was documented somewhere in Samples/Docs :(


tried this:

file = Posix.FILE.open(to, "w");
fileno = file.fileno();

Posix.write(fileno, str, str.size());

But it's gave just a little drop in time.
Xml parsing with stdout.printf() and pipe writing running for 3 seconds, with print via
GIO 6 seconds, with Posix.write - 5 seconds.

Strange behavior...

_______________________________________________
vala-list mailing list
vala-list gnome org
http://mail.gnome.org/mailman/listinfo/vala-list






[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]