Sane file I/O in SpiderMonkey




10 years ago
6 years ago


(Reporter: jorendorff, Unassigned)



Other Branch
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)


(Whiteboard: [needs-mentor])



10 years ago
The scope of this bug is:

- hg rm jsfile.{h,cpp}
- add a new ByteArray constructor for mutable byte-oriented binary buffers
- add a new File class for reading and writing files in binary mode
- add a few functions for converting ByteArrays to strings and vice versa, in just a few encodings (UTF-8 and Latin-1 works for me)

...stealing design work from Python again.  Of course Mozilla can't use this (already got our own, for one thing; security concerns, for another).  It's for embeddings like Treehydra.

I can comfortably say I'll never get around to this, but the bug should exist.  If anyone wants to put in some coding effort, I can quickly supply a design.
I will dance a jig when this bug gets fixed. mrbkap may know of volunteer candidates.


Comment 2

10 years ago
The ServerJS pseudo-wg is seeking comments for a cross-engine file system API.

Anybody interested in resolving this bug is encouraged to contribute. If they can come up with a good implementation, there is a high probability it will be implemented for SpiderMonkey and usable for resolving this bug.
(In reply to comment #0)
> - add a new ByteArray constructor for mutable byte-oriented binary buffers

This would be really useful in a few other places too (e.g. canvas's GetImageData)... Can we also specify a "no getters" policy (or, at the very least, that getters inherited from ByteArray.prototype are not called) for these?


10 years ago
Keywords: student-project


9 years ago
Blocks: 349821

Comment 4

7 years ago
if this bug is still open, i am interested in working on it.
jsfile was removed in bug 545275. It was not replaced with the mechanisms mentioned in this bug, it was just ripped out (see

That said, I don't know if there is a desire to pursue this or not, I'll leave that to one of the js people. Thanks for volunteering!
Depends on: 545275
Whiteboard: [needs-mentor]
@jorendorff and others, Can you guys clarify if this bug is still going to be pursued (See comment 5). I would like to help fix this, once the decision to pursue it has been confirmed.

By now, we have OS.File in Firefox. Perhaps the simplest path is to make use of it?

Comment 8

6 years ago
I don't think we really need this anymore.
Last Resolved: 6 years ago
Resolution: --- → WONTFIX
(In reply to Jason Orendorff [:jorendorff] from comment #8)
> I don't think we really need this anymore.

Just to be sure I understand: because we do not need file I/O in SpiderMonkey or because there is a solution?
You need to log in before you can comment on or make changes to this bug.