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
This commit is contained in:
@@ -342,6 +342,7 @@ enum wxFileKind
|
|||||||
typedef unsigned long mode_t;
|
typedef unsigned long mode_t;
|
||||||
#endif
|
#endif
|
||||||
WXDLLIMPEXP_BASE int wxStat( const wxChar *file_name, wxStructStat *buf );
|
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 wxAccess( const wxChar *pathname, int mode );
|
||||||
WXDLLIMPEXP_BASE int wxOpen( const wxChar *pathname, int flags, mode_t mode );
|
WXDLLIMPEXP_BASE int wxOpen( const wxChar *pathname, int flags, mode_t mode );
|
||||||
#else
|
#else
|
||||||
|
@@ -115,13 +115,17 @@ const int wxInvalidOffset = -1;
|
|||||||
// macros
|
// 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())
|
#define OS_FILENAME(s) (s.fn_str())
|
||||||
|
|
||||||
// ============================================================================
|
// ============================================================================
|
||||||
// implementation
|
// implementation
|
||||||
// ============================================================================
|
// ============================================================================
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
// wrappers around standard POSIX functions
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
#ifdef wxNEED_WX_UNISTD_H
|
#ifdef wxNEED_WX_UNISTD_H
|
||||||
|
|
||||||
WXDLLEXPORT int wxStat( const wxChar *file_name, wxStructStat *buf )
|
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 );
|
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 )
|
WXDLLEXPORT int wxAccess( const wxChar *pathname, int mode )
|
||||||
{
|
{
|
||||||
return access( wxConvFile.cWX2MB( pathname ), 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 );
|
return open( wxConvFile.cWX2MB( pathname ), flags, mode );
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif // wxNEED_WX_UNISTD_H
|
||||||
// wxNEED_WX_UNISTD_H
|
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
// wxPathList
|
// wxPathList
|
||||||
@@ -1232,7 +1240,7 @@ bool wxDirExists(const wxChar *pszPathName)
|
|||||||
#if defined(__WINDOWS__) || defined(__OS2__)
|
#if defined(__WINDOWS__) || defined(__OS2__)
|
||||||
// Windows fails to find directory named "c:\dir\" even if "c:\dir" exists,
|
// 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
|
// 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) )
|
while ( wxEndsWithPathSeparator(strPath) )
|
||||||
{
|
{
|
||||||
size_t len = strPath.length();
|
size_t len = strPath.length();
|
||||||
|
Reference in New Issue
Block a user