correct an example which had no chance of working
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@61218 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -47,14 +47,20 @@ enum TransferMode
|
|||||||
}
|
}
|
||||||
|
|
||||||
ftp.ChDir("/pub/2.8.9");
|
ftp.ChDir("/pub/2.8.9");
|
||||||
wxInputStream *i = ftp.GetInputStream("wxWidgets-2.8.9.tar.bz2");
|
const char *filename = "wxWidgets-2.8.9.tar.bz2";
|
||||||
|
int size = ftp.GetFileSize(filename);
|
||||||
|
if ( size == -1 )
|
||||||
|
{
|
||||||
|
wxLogError("Couldn't get the file size for \"%s\"", filename);
|
||||||
|
}
|
||||||
|
|
||||||
|
wxInputStream *i = ftp.GetInputStream(filename);
|
||||||
if ( !in )
|
if ( !in )
|
||||||
{
|
{
|
||||||
wxLogError("Couldn't get the file");
|
wxLogError("Couldn't get the file");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
size_t size = in->GetSize();
|
|
||||||
char *data = new char[size];
|
char *data = new char[size];
|
||||||
if ( !in->Read(data, size) )
|
if ( !in->Read(data, size) )
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user