Hi.
I am having a problem on Xulrunner 1.9a4 with
nsIFile.directoryEntries.hasMoreElements. It returns true leaving my
app in an endless loop, getNext returning the same file object again
and again.

Am calling it through JS and OS is WinXP.

Anyone else get this problem?

Thanks,
James

var subFile;
var file = Components.classes["@mozilla.org/file/local;
1"].createInstance(Components.interfaces.nsILocalFile);
file.initWithPath("C:\\");

while(file.directoryEntries.hasMoreElements()) {

        subFile = file.directoryEntries.getNext();
        subFile.QueryInterface(Components.interfaces.nsIFile);

        dump(subFile.path + "\n");

}

Gives:

C:\AUTOEXEC.BAT
C:\AUTOEXEC.BAT
C:\AUTOEXEC.BAT
C:\AUTOEXEC.BAT
...

_______________________________________________
dev-tech-xpcom mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-xpcom

Reply via email to