i forgot to precise that my input stream is well initialised with :

inputStream.init(file,0x01,0444,null);

Fabrice

Fabrice Esti�venart wrote:
hello,

i'd like to read a local file line by line, i try :

try
{
var file = Components.classes["@mozilla.org/file/local;1"].createInstance(Components.interfaces.nsILocalFile);


            file.initWithPath("c:\\myFile.txt");

var inputStream = Components.classes["@mozilla.org/network/file-input-stream;1"].createInstance(Components.interfaces.nsIFileInputStream);

var line;
while(inputStream.readLine(line))
{
alert(line); }
inputStream.close();
}
catch(e)
{
alert(e);
}


...but get the error type : inputStream.readLine is not a function

what to do ?

thx,

Fabrice


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

Reply via email to