fix truncate function in stream.vala, read/write in file.vapi.