]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/filename.cpp
set app name to argv[0] by default, as was done before
[wxWidgets.git] / src / common / filename.cpp
index 57907ce9e2dc2af7c1a093f929bd8073f4479130..46f2d0c03de56d57596b75d296ac36bd4b80c927 100644 (file)
     #include <unistd.h>
 #endif
 
+#ifdef __MWERKS__
+    #include <stat.h>
+    #include <unistd.h>
+    #include <unix.h>
+#endif
+
 // ----------------------------------------------------------------------------
 // private classes
 // ----------------------------------------------------------------------------
 
 // small helper class which opens and closes the file - we use it just to get
 // a file handle for the given file name to pass it to some Win32 API function
-#ifdef __WIN32__
+#if defined(__WIN32__) && !defined(__WXMICROWIN__)
 
 class wxFileHandle
 {
@@ -115,7 +121,7 @@ private:
 // private functions
 // ----------------------------------------------------------------------------
 
-#ifdef __WIN32__
+#if defined(__WIN32__) && !defined(__WXMICROWIN__)
 
 // convert between wxDateTime and FILETIME which is a 64-bit value representing
 // the number of 100-nanosecond intervals since January 1, 1601.
@@ -498,8 +504,7 @@ bool wxFileName::SameAs( const wxFileName &filepath, wxPathFormat format)
 bool wxFileName::IsCaseSensitive( wxPathFormat format )
 {
     // only DOS and OpenVMS filenames are case-sensitive
-    return ( GetFormat(format) != wxPATH_DOS &
-            GetFormat(format) != wxPATH_VMS );
+    return GetFormat(format) != wxPATH_DOS && GetFormat(format) != wxPATH_VMS;
 }
 
 bool wxFileName::IsRelative( wxPathFormat format )
@@ -1017,7 +1022,20 @@ bool wxFileName::GetTimes(wxDateTime *dtAccess,
                           wxDateTime *dtMod,
                           wxDateTime *dtChange) const
 {
-#if defined(__UNIX_LIKE__)
+#if defined(__UNIX_LIKE__) 
+    wxStructStat stBuf;
+    if ( wxStat(GetFullPath(), &stBuf) == 0 )
+    {
+        if ( dtAccess )
+            dtAccess->Set(stBuf.st_atime);
+        if ( dtMod )
+            dtMod->Set(stBuf.st_mtime);
+        if ( dtChange )
+            dtChange->Set(stBuf.st_ctime);
+
+        return TRUE;
+    }
+#elif defined(__WXMAC__)
     wxStructStat stBuf;
     if ( wxStat(GetFullPath(), &stBuf) == 0 )
     {