Opened 9 years ago

Closed 6 years ago

#3335 closed defect (fixed)

wx(F)FileStream is not able to use output stream

Reported by: phoenix_pl Owned by:
Priority: high Milestone: 2.8.9
Component: base Version:
Keywords: wxFileStream, wxFFileStream, streams Cc: phoenix_pl, leio
Blocked By: Blocking:
Patch: no

Description

Hello,

I was trying to use wxFFileStream in order to have
read-write stream. It appears that there is a problem
with this class. From what I have talked over on the
wxWidgets forum there's a lack of connection to
wxFFileOutputStream.

Here is a link to the topic:

http://wxforum.shadonet.com/viewtopic.php?
t=8562&highlight=

Attachments (1)

wxFFileStream_bug.zip download (103.7 KB) - added by phoenix_pl 9 years ago.
Sample project file and topic raport

Download all attachments as: .zip

Change History (4)

Changed 9 years ago by phoenix_pl

Sample project file and topic raport

comment:1 Changed 7 years ago by vadz

  • Component set to base
  • Keywords wxFileStream wxFFileStream streams added
  • Priority changed from normal to high
  • Status changed from new to confirmed
  • Summary changed from wxFFileStream is not able to use output stream to wx(F)FileStream is not able to use output stream

There is indeed a bug in wx(F)FileStream ctor: it opens the file using wx(F)FileInputStream ctor which, of course, opens it for reading only and writing to it always fails.

Solution is clear enough: open the file in read/write mode in the ctor and pass pointer to it to both base classes. But I don't have time to do it right now, as even though it's a simple change it still needs to be tested.

Increasing the priority though as it's embarassing to have such a simple class completely broken.

comment:2 Changed 7 years ago by vadz

  • Milestone set to 2.8.9
  • Resolution set to port to stable
  • Status changed from confirmed to portneeded

Fixed in the trunk as r54246, should be backported to 2.8 later (the new argument of wxFFileStream could be omitted entirely or added inside wxABI_VERSION check).

comment:3 Changed 6 years ago by vadz

  • Resolution changed from port to stable to fixed
  • Status changed from portneeded to closed

Backported to 2.8 as r54418, will be in 2.8.9.

Note: See TracTickets for help on using tickets.