Sane file I/O in SpiderMonkey

RESOLVED WONTFIX

Status

()

RESOLVED WONTFIX
10 years ago
6 years ago

People

(Reporter: jorendorff, Unassigned)

Tracking

({student-project})

Other Branch
student-project
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [needs-mentor])

(Reporter)

Description

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.

/be

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.

http://groups.google.ca/group/serverjs/browse_thread/thread/acf6a054ab5e0b6/69be0f7ec38452af?hl=en&ie=UTF-8&oe=utf-8&q=file+api+brouhaha&pli=1
(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?
(Reporter)

Updated

9 years ago
Keywords: student-project

Updated

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 http://groups.google.com/group/mozilla.dev.tech.js-engine/browse_thread/thread/e65bcf72800dcc16).

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.

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

Comment 8

6 years ago
I don't think we really need this anymore.
Status: NEW → RESOLVED
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.