Closed Bug 26312 Opened 26 years ago Closed 26 years ago

nsFileTransport does not support Offset writing.

Categories

(Core :: Networking, defect, P3)

All
Other
defect

Tracking

()

VERIFIED INVALID

People

(Reporter: yixiong.zou, Assigned: warrensomebody)

Details

Attachments

(1 file)

The new nsFileTransport::OpenOutputStream does not work if you try to open the file with an offset. The file will be zeroed out when the file got opened. The following test case can verify this: mozilla/netwerk/test/TestRawCache. Run the "TestRawCache -f", this will generates assertion messages.
The reason why this bug happens is in nsFileTransport::OpenOutputStream, it uses the flag PR_TRUNCATE. This will zero out the file regard if it exists or not. So adding a test statement can solve this problem flag = PR_WRONLY | PR_CREATE_FILE | PR_TRUNCATE ; if(startPosition) flag = PR_WRONLY | PR_CREATE_FILE ; rv = NS_NewFileOutputStream (mFile, flags, 0664, getter_AddRefs(str)) ;
I've send in a patch for this. Could anyone give it a review and check it in?
->warren
Assignee: gagan → warren
Target Milestone: M14
I think this bug is now invalid. Looks like dougt removed the truncate flag altogether. However, in general, I want to pass the flags in to these calls as a parameter which will take a little API tweakage.
Status: NEW → RESOLVED
Closed: 26 years ago
Resolution: --- → INVALID
verified invalid
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: