wxT(" :;");
#endif
- wxChar *val = wxGetenv (WXSTRINGCAST envVariable);
- if (val && *val)
+ wxString val ;
+ if (wxGetEnv (WXSTRINGCAST envVariable, &val))
{
wxChar *s = MYcopystring (val);
wxChar *save_ptr, *token = wxStrtok (s, PATH_TOKS, &save_ptr);
return false;
}
#elif defined(__OS2__)
- if ( ::DosCopy(file2, file2, overwrite ? DCPY_EXISTING : 0) != 0 )
+ if ( ::DosCopy((PSZ)file1.c_str(), (PSZ)file2.c_str(), overwrite ? DCPY_EXISTING : 0) != 0 )
return false;
#elif defined(__PALMOS__)
// TODO with http://www.palmos.com/dev/support/docs/protein_books/Memory_Databases_Files/
return false;
-#else // !Win32
+#elif wxUSE_FILE // !Win32
wxStructStat fbuf;
// get permissions of file1
return false;
}
#endif // OS/2 || Mac
+
+#else // !Win32 && ! wxUSE_FILE
+
+ // impossible to simulate with wxWidgets API
+ wxUnusedVar(file1);
+ wxUnusedVar(file2);
+ wxUnusedVar(overwrite);
+ return false;
+
#endif // __WXMSW__ && __WIN32__
return true;
}
// does the path exists? (may have or not '/' or '\\' at the end)
-bool wxPathExists(const wxChar *pszPathName)
+bool wxDirExists(const wxChar *pszPathName)
{
wxString strPath(pszPathName);
return (ret != (DWORD)-1) && (ret & FILE_ATTRIBUTE_DIRECTORY);
#elif defined(__OS2__)
- return (::DosSetCurrentDir(WXSTRINGCAST strPath));
+ return (::DosSetCurrentDir((PSZ)(WXSTRINGCAST strPath)));
#else // !__WIN32__
wxStructStat st;
return buf;
#else
+ wxUnusedVar(prefix);
+ wxUnusedVar(buf);
// wxFileName::CreateTempFileName needs wxFile class enabled
return NULL;
#endif
//
wxFileKind wxGetFileKind(int fd)
{
-#if defined __WXMSW__ && !defined __WXWINCE__ && defined wxGetOSFHandle
+#if defined __WXMSW__ && !defined __WXWINCE__ && defined wxGetOSFHandle && !defined(__WINE__)
switch (::GetFileType(wxGetOSFHandle(fd)) & ~FILE_TYPE_REMOTE)
{
case FILE_TYPE_CHAR:
wxFileKind wxGetFileKind(FILE *fp)
{
- // note: the watcom rtl dll doesn't have fileno (the static lib does)
-#if !defined wxFILEKIND_STUB && !(defined __WATCOMC__ && defined __SW_BR)
- return wxGetFileKind(fileno(fp));
-#else
+ // Note: The watcom rtl dll doesn't have fileno (the static lib does).
+ // Should be fixed in version 1.4.
+#if defined(wxFILEKIND_STUB) || \
+ (defined(__WATCOMC__) && __WATCOMC__ <= 1230 && defined(__SW_BR))
(void)fp;
return wxFILE_KIND_DISK;
+#else
+ return wxGetFileKind(fileno(fp));
#endif
}