Closed Bug 1028240 Opened 12 years ago Closed 12 years ago

[OS.File] Can't write empty files.

Categories

(Toolkit Graveyard :: OS.File, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 1023685

People

(Reporter: paul, Assigned: janx)

References

Details

Attachments

(1 file)

STR: - open a file - empty it (Ctrl-A, delete) - try to save The star stays next to the file name.
Looks like it is saving the file to disk, but the UI is not being updated. I'm seeing this in the console when saving on empty file: ************************* A coding exception was thrown and uncaught in a Task. Full message: TypeError: C pointer missing bytes indication. Full stack: EXCEPTION_CONSTRUCTORS.TypeError@resource://gre/modules/osfile/osfile_async_front.jsm:85:5 post/<@resource://gre/modules/osfile/osfile_async_front.jsm:467:11 TaskImpl_run@resource://gre/modules/Task.jsm:286:1 Handler.prototype.process@resource://gre/modules/Promise.jsm -> resource://gre/modules/Promise-backend.js:866:9 this.PromiseWalker.walkerLoop@resource://gre/modules/Promise.jsm -> resource://gre/modules/Promise-backend.js:742:7 *************************
Jan, could you look at this?
Flags: needinfo?(janx)
Looking.
Assignee: nobody → janx
Status: NEW → ASSIGNED
Flags: needinfo?(janx)
Comment on attachment 8471632 [details] [diff] [review] [OS.File] Allow writing empty files. David, could you please have a look? In the line I changed, it seems that legitimate writes with `options.bytes === 0` make `normalizeToPointer()` fail with the aforementioned Type Error. Most other calls to `normalizeToPointer()` don't make `options.bytes` fall back to `undefined`, and my patch fixes the empty-file-write issues we're seeing.
Attachment #8471632 - Flags: review?(dteller)
Component: Developer Tools: WebIDE → OS.File
Product: Firefox → Toolkit
Summary: Project Editor: can't save empty file → [OS.File] Can't write empty files.
Hardware: x86_64 → All
This looks like a dupe of bug 1023685. Do you want to head over towards that bug and finish fixing it?
Comment on attachment 8471632 [details] [diff] [review] [OS.File] Allow writing empty files. Btw, we don't want to remove the `|| undefined`, as it causes warnings. We want to add something that checks whether `options.bytes` is 0.
Attachment #8471632 - Flags: review?(dteller)
Indeed, thanks.
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → DUPLICATE
Product: Toolkit → Toolkit Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: