Closed
Bug 1028240
Opened 12 years ago
Closed 12 years ago
[OS.File] Can't write empty files.
Categories
(Toolkit Graveyard :: OS.File, defect)
Toolkit Graveyard
OS.File
Tracking
(Not tracked)
RESOLVED
DUPLICATE
of bug 1023685
People
(Reporter: paul, Assigned: janx)
References
Details
Attachments
(1 file)
|
1.03 KB,
patch
|
Details | Diff | Splinter Review |
STR:
- open a file
- empty it (Ctrl-A, delete)
- try to save
The star stays next to the file name.
Comment 1•12 years ago
|
||
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
*************************
| Assignee | ||
Comment 3•12 years ago
|
||
Looking.
Assignee: nobody → janx
Status: NEW → ASSIGNED
Flags: needinfo?(janx)
| Assignee | ||
Comment 4•12 years ago
|
||
| Assignee | ||
Comment 5•12 years ago
|
||
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)
| Assignee | ||
Comment 6•12 years ago
|
||
| Assignee | ||
Updated•12 years ago
|
Component: Developer Tools: WebIDE → OS.File
Product: Firefox → Toolkit
Summary: Project Editor: can't save empty file → [OS.File] Can't write empty files.
| Assignee | ||
Updated•12 years ago
|
Hardware: x86_64 → All
Comment 7•12 years ago
|
||
This looks like a dupe of bug 1023685. Do you want to head over towards that bug and finish fixing it?
Comment 8•12 years ago
|
||
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)
| Assignee | ||
Comment 9•12 years ago
|
||
Indeed, thanks.
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → DUPLICATE
Updated•3 years ago
|
Product: Toolkit → Toolkit Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•