#include "wx/stream.h"
+#ifdef HAVE_STATFS
+ #include <sys/vfs.h>
+#endif // HAVE_STATFS
+
#if wxUSE_GUI
#include "wx/unix/execute.h"
#endif
close(pipeErr[1]); // close writing side
}
-#if wxUSE_GUI
+#if wxUSE_GUI && !defined(__WXMICROWIN__)
wxEndProcessData *data = new wxEndProcessData;
if ( sync )
return -1;
}
+bool wxGetDiskSpace(const wxString& path, wxLongLong *pTotal, wxLongLong *pFree)
+{
+#ifdef HAVE_STATFS
+
+ struct statfs fs;
+ if ( statfs(path, &fs) != 0 )
+ {
+ wxLogSysError("Failed to get file system statistics");
+
+ return FALSE;
+ }
+
+ if ( pTotal )
+ {
+ *pTotal = wxLongLong(fs.f_blocks) * fs.f_bsize;
+ }
+
+ if ( pFree )
+ {
+ *pFree = wxLongLong(fs.f_bavail) * fs.f_bsize;
+ }
+
+ return TRUE;
+#endif // HAVE_STATFS
+
+ return FALSE;
+}
+
// ----------------------------------------------------------------------------
// env vars
// ----------------------------------------------------------------------------