// macros
// ----------------------------------------------------------------------------
-// we need to translate Mac filenames before passing them to OS functions
+// translate the filenames before passing them to OS functions
#define OS_FILENAME(s) (s.fn_str())
// ============================================================================
// implementation
// ============================================================================
+// ----------------------------------------------------------------------------
+// wrappers around standard POSIX functions
+// ----------------------------------------------------------------------------
+
#ifdef wxNEED_WX_UNISTD_H
WXDLLEXPORT int wxStat( const wxChar *file_name, wxStructStat *buf )
return stat( wxConvFile.cWX2MB( file_name ), buf );
}
+WXDLLEXPORT int wxLstat( const wxChar *file_name, wxStructStat *buf )
+{
+ return lstat( wxConvFile.cWX2MB( file_name ), buf );
+}
+
WXDLLEXPORT int wxAccess( const wxChar *pathname, int mode )
{
return access( wxConvFile.cWX2MB( pathname ), mode );
return open( wxConvFile.cWX2MB( pathname ), flags, mode );
}
-#endif
- // wxNEED_WX_UNISTD_H
+#endif // wxNEED_WX_UNISTD_H
// ----------------------------------------------------------------------------
// wxPathList
return wxMacCFStringHolder(cfMutableString).AsString() ;
}
+#ifndef __LP64__
+
wxString wxMacFSSpec2MacFilename( const FSSpec *spec )
{
FSRef fsRef ;
wxMacPathToFSRef( path , &fsRef ) ;
err = FSRefMakeFSSpec( &fsRef , spec ) ;
}
+#endif
#endif // __WXMAC__
#if defined(__WINDOWS__) || defined(__OS2__)
// Windows fails to find directory named "c:\dir\" even if "c:\dir" exists,
// so remove all trailing backslashes from the path - but don't do this for
- // the pathes "d:\" (which are different from "d:") nor for just "\"
+ // the paths "d:\" (which are different from "d:") nor for just "\"
while ( wxEndsWithPathSeparator(strPath) )
{
size_t len = strPath.length();
// Get a temporary filename, opening and closing the file.
wxChar *wxGetTempFileName(const wxString& prefix, wxChar *buf)
{
-#if wxUSE_FILE
- wxString filename = wxFileName::CreateTempFileName(prefix);
- if ( filename.empty() )
+ wxString filename;
+ if ( !wxGetTempFileName(prefix, filename) )
return NULL;
if ( buf )
buf = MYcopystring(filename);
return buf;
-#else
- wxUnusedVar(prefix);
- wxUnusedVar(buf);
- // wxFileName::CreateTempFileName needs wxFile class enabled
- return NULL;
-#endif
}
bool wxGetTempFileName(const wxString& prefix, wxString& buf)
{
- buf = wxGetTempFileName(prefix);
+#if wxUSE_FILE
+ buf = wxFileName::CreateTempFileName(prefix);
return !buf.empty();
+#else // !wxUSE_FILE
+ wxUnusedVar(prefix);
+ wxUnusedVar(buf);
+
+ return false;
+#endif // wxUSE_FILE/!wxUSE_FILE
}
// Get first file name matching given wild card.
#elif defined( __WINDOWS__ )
return wxCheckGenericPermission(path, GENERIC_WRITE);
#else
+ wxUnusedVar(path);
// TODO
return false;
#endif
#elif defined( __WINDOWS__ )
return wxCheckGenericPermission(path, GENERIC_READ);
#else
+ wxUnusedVar(path);
// TODO
return false;
#endif
#elif defined( __WINDOWS__ )
return wxCheckGenericPermission(path, GENERIC_EXECUTE);
#else
+ wxUnusedVar(path);
// TODO
return false;
#endif