Re: [Vala] Vala 0.11.6 How do I copy a file using GInputStream and GOutputStream?
- From: Jürg Billeter <j bitron ch>
- To: Graham Whelan <gawhelan gmail com>
- Cc: vala-list gnome org
- Subject: Re: [Vala] Vala 0.11.6 How do I copy a file using GInputStream and GOutputStream?
- Date: Tue, 01 Mar 2011 19:29:35 +0100
On Tue, 2011-03-01 at 18:21 +0000, Graham Whelan wrote:
I'm trying to copy a file using GLib.InputStream and GLib.OutputStream
but the copied file ends up corrupted.
Sample code:
uint8 buffer[4096];
size_t read;
while (true) {
read = input.read (buffer);
if (read > 0) {
output.write (buffer);
This should work with slicing:
output.write (buffer[0:read]);
Jürg
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]