diff --git a/wutil.c b/wutil.c index 060547400..11b275a01 100644 --- a/wutil.c +++ b/wutil.c @@ -549,3 +549,15 @@ int wmkdir( const wchar_t *name, int mode ) char *name_narrow =wutil_wcs2str(name); return mkdir( name_narrow, mode ); } + +int wrename( const wchar_t *old, const wchar_t *new ) +{ + char *old_narrow =wutil_wcs2str(old); + char *new_narrow =wcs2str(new); + int res; + + res = rename( old_narrow, new_narrow ); + free( new_narrow ); + + return res; +} diff --git a/wutil.h b/wutil.h index 0f3501731..fcabfa93d 100644 --- a/wutil.h +++ b/wutil.h @@ -138,4 +138,9 @@ wchar_t *wgetenv( const wchar_t *name ); */ int wmkdir( const wchar_t *dir, int mode ); +/** + Wide character version of rename +*/ +int wrename( const wchar_t *old, const wchar_t *new ); + #endif