From 8285242ff660b4424279350ba38abe109591911a Mon Sep 17 00:00:00 2001 From: axel Date: Sat, 21 Oct 2006 08:33:47 +1000 Subject: [PATCH] Add wrename wrapper around rename function darcs-hash:20061020223347-ac50b-1735f7e63b87f021ca71c44e5278726d3e8debc3.gz --- wutil.c | 12 ++++++++++++ wutil.h | 5 +++++ 2 files changed, 17 insertions(+) diff --git a/wutil.c b/wutil.c index 0605474..11b275a 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 0f35017..fcabfa9 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