It has been a long time since I did any of this, but in one script I made I read a text config file. In that code I use
var s = file.GETS ([0]); I don't do any file.OPEN() in my code, I assume the file gets opened in the constructor. I hope this helps. Regards, Fredrik On 18 February 2011 11:25, Walter <wra...@interfree.it> wrote: > Hi at all ! > I have a very BIG problem with a js routine > I can't read a ascii file !!! > > > > ck_op=file.OPEN(); // <-- check line > file = new r3File(R3FIA_FileName, > "/home/walter/Scrivania/Lavori/Game_3d/models/alb.egg", R3FIA_Mode, "ra"); > ck_op=file.OPEN(); > // read line by line > while(file.GETS[0]) { > line = file.GetBuffer(); > parser(line); > conten[li]=line; // <--- check line > li++ // <---- check line > } > file.CLOSE(); > //// start write file for check > file_test2 = new r3File(R3FIA_FileName, > "/home/walter/Scrivania/Lavori/test2.txt", R3FIA_Mode, "w+"); > file_test2.PUTS(" "+ck_op+" "+file_test2.OPEN()+"\n" ); > for (i=1; i<30; i++){ > file_test2.PUTS(conten[i]+"\n"); > } > file_test2.PUTS("linee contate "+li+"\n" ); > file_test2.CLOSE(); > > at the end of this I found a file with only value of Open !!! > I'm good to write but not to read XD > Someone can tell me where I wrong?? > > Bye to All >