Add a new wxFileName function to resolve symlinks to absolute paths

This commit is contained in:
Ian McInerney
2021-04-01 18:40:21 +01:00
parent 152a2079b4
commit 53bd1391f4
5 changed files with 135 additions and 2 deletions

View File

@@ -381,7 +381,10 @@ enum wxPosixPermissions
#define wxCRT_Access access
#define wxCRT_Chmod chmod
#define wxCRT_Readlink readlink
#define wxHAS_NATIVE_LSTAT
#define wxHAS_NATIVE_READLINK
#endif // platforms
// if the platform doesn't have symlinks, define wxCRT_Lstat to be the same as
@@ -406,6 +409,11 @@ inline int wxChmod(const wxString& path, mode_t mode)
inline int wxOpen(const wxString& path, int flags, mode_t mode)
{ return wxCRT_Open(path.fn_str(), flags, mode); }
#if defined(wxHAS_NATIVE_READLINK)
inline int wxReadlink(const wxString& path, char* buf, int size)
{ return wxCRT_Readlink(path.fn_str(), buf, size); }
#endif
inline int wxStat(const wxString& path, wxStructStat *buf)
{ return wxCRT_Stat(path.fn_str(), buf); }
inline int wxLstat(const wxString& path, wxStructStat *buf)