X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/d5a0a2bcf856f97702d5f8469e6e2b925ed93dfa..2b041d4673b8e1f2b430d95c0c80712663859b58:/src/common/filename.cpp diff --git a/src/common/filename.cpp b/src/common/filename.cpp index 88fe2d48ea..8ec78cad96 100644 --- a/src/common/filename.cpp +++ b/src/common/filename.cpp @@ -619,7 +619,7 @@ static int wxOpenWithDeleteOnClose(const wxString& filename) HANDLE h = ::CreateFile(filename, access, 0, NULL, disposition, attributes, NULL); - return wxOpenOSFHandle(h, 0); + return wxOpenOSFHandle(h, wxO_BINARY); } #endif // wxOpenOSFHandle @@ -649,7 +649,7 @@ static bool wxTempOpen(wxFFile *file, const wxString& path, bool *deleteOnClose) return file->Open(path, _T("w+b")); #else // wx_fdopen int fd = wxTempOpen(path, deleteOnClose); - if (fd != -1) + if (fd == -1) return false; file->Attach(wx_fdopen(fd, "w+b")); return file->IsOpened(); @@ -2216,7 +2216,7 @@ bool wxFileName::GetTimes(wxDateTime *dtAccess, // not 9x bool ok; FILETIME ftAccess, ftCreate, ftWrite; - if ( DirExists() ) // Don't use IsDir, because it returns false even if it's a directory + if ( IsDir() ) { // implemented in msw/dir.cpp extern bool wxGetDirectoryTimes(const wxString& dirname, @@ -2255,6 +2255,7 @@ bool wxFileName::GetTimes(wxDateTime *dtAccess, return true; } #elif defined(__UNIX_LIKE__) || defined(__WXMAC__) || defined(__OS2__) || (defined(__DOS__) && defined(__WATCOMC__)) + // no need to test for IsDir() here wxStructStat stBuf; if ( wxStat( GetFullPath().c_str(), &stBuf) == 0 ) {