i use this code to read a file line by line :

var inFile = Components.classes["@mozilla.org/file/local;1"].createInstance(Components.interfaces.nsILocalFile);
inFile.initWithPath("myFile.txt");
var inputStream = Components.classes["@mozilla.org/network/file-input-stream;1"].createInstance(Components.interfaces.nsIFileInputStream);
inputStream.init(inFile,0x01,0444,null);
inputStream = inputStream.QueryInterface(Components.interfaces.nsILineInputStream);


var line = {};
                
while(inputStream.readLine(line))
{
        //do something
}

...although I end it by a carriage return (\n), the last line is NEVER read

the solution I found is to end the file by a carriage return FOLLOWED BY a tabulation (\t) but that does not satisfy me

my OS is Windows 2000

any idea ? thanks in advance,

Fabrice
_______________________________________________
Mozilla-xpcom mailing list
[EMAIL PROTECTED]
http://mail.mozilla.org/listinfo/mozilla-xpcom

Reply via email to