Closed
Bug 3534
Opened 26 years ago
Closed 25 years ago
[PP] PR_Seek should allow offsets past EOF
Categories
(NSPR :: NSPR, defect, P3)
Tracking
(Not tracked)
VERIFIED
FIXED
People
(Reporter: gordon, Assigned: sdagley)
Details
John McMullen reports that PR_Seek on other platforms actually allows an offset
past the end of file. PR_Seek on macintosh should be
made to work the same way.
Updated•26 years ago
|
Assignee: wtc → gordon
Comment 1•26 years ago
|
||
Reassigned the bug to gordon.
Don, pink fixed the only one known place (in the registry code) where this was
called with the win/unix assumption. The real fix is to make the win/unix
assumption valid always in future.
Pink's fix was to write out enough bogus data to make the seek work.
Comment 4•26 years ago
|
||
And i'm sure that I'm writing out random bits of memory to disk, so there are
certain privacy issues involved in that ;)
Note that while PR_Seek on Unix/Win platforms allows setting the file pointer
beyond the current end of file, the file size itself is not changed by the seek
operation. The next PR_Write call causes the write to happen at the new pointer;
the data between the original end-of-file position and the position of the file
pointer after PR_Seek is zero-filled by the OS.
That is, if PR_Seek is used to seek beyond the end-of-file and the file is
closed, there will be no change to the contents of the file (or the file size)
on Unix/win platforms.
To emulate the same semantics on Mac, one can save the file pointer in nspr's fd
and extend the file on the next call to PR_Write. Also, file extension should be
done with zero-filled pages, rather than random data.
Assignee | ||
Updated•25 years ago
|
Assignee: gordon → sdagley
Status: ASSIGNED → NEW
Assignee | ||
Comment 7•25 years ago
|
||
Offloading some of gordon's doomage
Comment 8•25 years ago
|
||
NSPR now has its own Bugzilla product. Moving this bug to the NSPR product.
Assignee | ||
Updated•25 years ago
|
Status: NEW → ASSIGNED
Assignee | ||
Updated•25 years ago
|
Status: ASSIGNED → RESOLVED
Closed: 25 years ago
Resolution: --- → FIXED
Assignee | ||
Comment 9•25 years ago
|
||
Fix checked in. The old code would actually re-set the EOF on a seek past the
current EOF but did not advance the file mark after resetting EOF.
Comment 10•25 years ago
|
||
this fix is not visible to qa. if you think this bug should be reopened,
please do so.
will mark as verified.
Updated•24 years ago
|
Target Milestone: M6 → ---
You need to log in
before you can comment on or make changes to this bug.
Description
•