[Vala] read file line by line
- From: Mic <mictadlo gmail com>
- To: vala-list gnome org
- Subject: [Vala] read file line by line
- Date: Fri, 13 Apr 2012 20:10:15 +1000
Hello,
Is this the best and fastest way to read a file line by line?
*static int main (string[] args) {*
* FileStream infile;*
* infile = FileStream.open(args[1], "r");*
* char buffer[1024];*
* int count = 0;*
* while (!infile.eof()) {*
* infile.gets(buffer);*
* count++;*
* }*
* stdout.printf("%i\n",count);*
* return 0;*
*}*
*
*
Thank you in advance.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]