wxFileOutputStream in wxMSW 2.7.1
Vadim Zeitlin
vadim at wxwindows.org
Wed Nov 1 17:48:16 PST 2006
On Wed, 01 Nov 2006 17:05:47 -0800 John Skiff <john at dgi.com> wrote:
JS> I'm unable to delete the file associated with a wxFileOutputStream in an
JS> application built with wxMSW 2.7.1. I get "access denied".
This is expected -- you need to destroy wxFileOutputStream which keeps the
file opened first.
JS> I think that something is broken in wx2.7.1 because the console sample
JS> app fails with
JS>
JS> File stream size: 3
JS> foo ERROR: failed to remove the file 'testdata.fs'.
JS>
JS> on the code
JS>
JS> if ( !wxRemoveFile(filename) )
JS> {
JS> wxPrintf(_T("ERROR: failed to remove the file '%s'.\n"),
JS> filename.c_str());
JS> }
JS>
JS> which is similar to my own code.
The console code is incorrect, it should close wxFileInputStream before
removing the file. I've fixed this in the cvs.
Regards,
VZ
--
TT-Solutions: wxWidgets consultancy and technical support
http://www.tt-solutions.com/
More information about the wx-users
mailing list