Closed
Bug 18949
Opened 25 years ago
Closed 25 years ago
file buffering in nsIFileStream ignores seeks.
Categories
(SeaMonkey :: UI Design, defect, P3)
Tracking
(Not tracked)
VERIFIED
FIXED
People
(Reporter: Bienvenu, Assigned: dougt)
Details
Local mail folders were getting corrupted because the buffering added to nsIFileStream ignores seeks. So the sequence of calls need to corrupt a file is as simple as this: stream->write(buf)... seek (somewhere else) close the output buffers will get written out at close time, at the location we've seeked to, not the location we thought we were at when we did the write. A simple fix for this is to make seek do a flush. I've changed my code to do a flush after every write, but other clients could get bit in very painful ways.
Reporter | ||
Updated•25 years ago
|
Severity: normal → critical
Reporter | ||
Comment 1•25 years ago
|
||
I've marked this critical since it can corrupt files.
Assignee | ||
Comment 2•25 years ago
|
||
sounds like a regression. At one point seek would flush buffers. Blame does not see though some code rearragement. Adding people to cc list. Warren, Simon, do you think any of your changes could have cause this directly or indirectly?
Comment 3•25 years ago
|
||
The only changes I made were to un-inline some methods in nsFileImpl, and not do PR_Sync on read-only file close.
Assignee | ||
Comment 4•25 years ago
|
||
it is a simple fix. We need to make seek() call flush().
Assignee | ||
Updated•25 years ago
|
Status: NEW → RESOLVED
Closed: 25 years ago
Resolution: --- → FIXED
Assignee | ||
Comment 5•25 years ago
|
||
thats what you said!!.. :-) fixed.
Updated•24 years ago
|
QA Contact: don → sairuh
Updated•20 years ago
|
Product: Core → Mozilla Application Suite
You need to log in
before you can comment on or make changes to this bug.
Description
•