+static void TestDiskInfo()
+{
+ puts("*** Testing wxGetDiskSpace() ***");
+
+ for ( ;; )
+ {
+ char pathname[128];
+ printf("\nEnter a directory name: ");
+ if ( !fgets(pathname, WXSIZEOF(pathname), stdin) )
+ break;
+
+ // kill the last '\n'
+ pathname[strlen(pathname) - 1] = 0;
+
+ wxLongLong total, free;
+ if ( !wxGetDiskSpace(pathname, &total, &free) )
+ {
+ wxPuts(_T("ERROR: wxGetDiskSpace failed."));
+ }
+ else
+ {
+ wxPrintf(_T("%sKb total, %sKb free on '%s'.\n"),
+ (total / 1024).ToString().c_str(),
+ (free / 1024).ToString().c_str(),
+ pathname);
+ }
+ }
+}
+