// of course, this doesn't protect us against malicious users...
wxFileName fn;
fn.AssignTempFileName(appname);
+#if wxUSE_DATETIME
m_dir.Printf(_T("%s%c%s_dbgrpt-%lu-%s"),
fn.GetPath().c_str(), wxFILE_SEP_PATH, appname.c_str(),
wxGetProcessId(),
wxDateTime::Now().Format(_T("%Y%m%dT%H%M%S")).c_str());
+#else
+ m_dir.Printf(_T("%s%c%s_dbgrpt-%lu"),
+ fn.GetPath().c_str(), wxFILE_SEP_PATH, appname.c_str(),
+ wxGetProcessId());
+#endif
// as we are going to save the process state there use restrictive
// permissions
{
# if wxUSE_FILESYSTEM
file = fsys.OpenFile(m_data[i].File);
+# if wxUSE_DATETIME
modif = file && file->GetModificationTime() > m_data[i].Time;
+# else // wxUSE_DATETIME
+ modif = true;
+# endif // wxUSE_DATETIME
if (!file)
{
wxLogError(_("Cannot open file '%s'."), m_data[i].File.c_str());
}
wxDELETE(file);
wxUnusedVar(file);
-# else
+# else // wxUSE_FILESYSTEM
+# if wxUSE_DATETIME
modif = wxDateTime(wxFileModificationTime(m_data[i].File)) > m_data[i].Time;
-# endif
+# else // wxUSE_DATETIME
+ modif = true;
+# endif // wxUSE_DATETIME
+# endif // wxUSE_FILESYSTEM
}
if (modif)
}
ProcessPlatformProperty(m_data[i].Doc->GetRoot());
+#if wxUSE_DATETIME
#if wxUSE_FILESYSTEM
m_data[i].Time = file->GetModificationTime();
-#else
+#else // wxUSE_FILESYSTEM
m_data[i].Time = wxDateTime(wxFileModificationTime(m_data[i].File));
-#endif
+#endif // wxUSE_FILESYSTEM
+#endif // wxUSE_DATETIME
}
# if wxUSE_FILESYSTEM
// the macro below to do it
//#define CHANGE_SYSTEM_DATE
+#if wxUSE_DATETIME
+
#ifndef __WINDOWS__
#undef CHANGE_SYSTEM_DATE
#endif
#endif // CHANGE_SYSTEM_DATE
}
+#endif // wxUSE_DATETIME