Axel Hecht wrote:
Hi,
after Darin's recent check-in, lot's of folks are confused how to write to a file from js. I guess most folks have wholeheartly copied jslib, which used the file-transport-service.
That obviously died (though the contract id is still in nsNetCID.h).

I looked a tad around and found
"@mozilla.org/network/file-output-stream;1", but that seems to be new.

Could someone suggest the "good way" to write to a file, working on builds both prior and after that check-in?

Thanx

Axel



"@mozilla.org/network/file-output-stream;1" -> nsIFileOutputStream
"@mozilla.org/network/file-input-stream;1" -> nsIFileInputStream

will work in all versions of mozilla since 1.0 (and probably well before that too). note: these interfaces and contract-ids are _NOT_ frozen. this means they may change in future versions of mozilla; however, i can say that i don't foresee any changes to these.

if you need to asychronously read/write file streams, then you are stuck having to write code specific to mozilla 1.3 or previous versions.

darin




Reply via email to