wxFileOutputStream in wxMSW 2.7.1

John Skiff john at dgi.com
Thu Nov 2 09:51:53 PST 2006


That worked.

Thanks a lot,
john

Vadim Zeitlin wrote:
> 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
>
>   




More information about the wx-users mailing list