+ printf("Size of '%s' is %d bytes.\n", filename, size);
+ }
+ else
+ {
+ printf("ERROR: '%s' doesn't exist\n", filename);
+ }
+}
+
+static void TestFtpMisc()
+{
+ puts("*** Testing miscellaneous wxFTP functions ***");
+
+ if ( ftp.SendCommand("STAT") != '2' )
+ {
+ puts("ERROR: STAT failed");
+ }
+ else
+ {
+ printf("STAT returned:\n\n%s\n", ftp.GetLastResult().c_str());
+ }
+
+ if ( ftp.SendCommand("HELP SITE") != '2' )
+ {
+ puts("ERROR: HELP SITE failed");
+ }
+ else
+ {
+ printf("The list of site-specific commands:\n\n%s\n",
+ ftp.GetLastResult().c_str());
+ }
+}
+
+static void TestFtpInteractive()
+{
+ puts("\n*** Interactive wxFTP test ***");
+
+ char buf[128];
+
+ for ( ;; )
+ {
+ printf("Enter FTP command: ");
+ if ( !fgets(buf, WXSIZEOF(buf), stdin) )
+ break;
+
+ // kill the last '\n'
+ buf[strlen(buf) - 1] = 0;
+
+ // special handling of LIST and NLST as they require data connection
+ wxString start(buf, 4);
+ start.MakeUpper();
+ if ( start == "LIST" || start == "NLST" )