From 56614e51f9cd06ead4a43d318426d37a6378b710 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 21 Oct 2006 14:41:20 +0000 Subject: [PATCH] added wxLstat() (one of patches from bug 1052385) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@42199 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/filefn.h | 1 + src/common/filefn.cpp | 16 ++++++++++++---- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/include/wx/filefn.h b/include/wx/filefn.h index 3915a0176b..344dd0401f 100644 --- a/include/wx/filefn.h +++ b/include/wx/filefn.h @@ -342,6 +342,7 @@ enum wxFileKind typedef unsigned long mode_t; #endif WXDLLIMPEXP_BASE int wxStat( const wxChar *file_name, wxStructStat *buf ); + WXDLLIMPEXP_BASE int wxLstat( const wxChar *file_name, wxStructStat *buf ); WXDLLIMPEXP_BASE int wxAccess( const wxChar *pathname, int mode ); WXDLLIMPEXP_BASE int wxOpen( const wxChar *pathname, int flags, mode_t mode ); #else diff --git a/src/common/filefn.cpp b/src/common/filefn.cpp index 5c8e11038e..caaf99caf1 100644 --- a/src/common/filefn.cpp +++ b/src/common/filefn.cpp @@ -115,13 +115,17 @@ const int wxInvalidOffset = -1; // 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 ) @@ -129,6 +133,11 @@ 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 ); @@ -139,8 +148,7 @@ WXDLLEXPORT int wxOpen( const wxChar *pathname, int flags, mode_t mode ) return open( wxConvFile.cWX2MB( pathname ), flags, mode ); } -#endif - // wxNEED_WX_UNISTD_H +#endif // wxNEED_WX_UNISTD_H // ---------------------------------------------------------------------------- // wxPathList @@ -1232,7 +1240,7 @@ bool wxDirExists(const wxChar *pszPathName) #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(); -- 2.45.2