Add wrename wrapper around rename function

darcs-hash:20061020223347-ac50b-1735f7e63b87f021ca71c44e5278726d3e8debc3.gz
This commit is contained in:
axel 2006-10-21 08:33:47 +10:00
parent c0a54955e7
commit 8285242ff6
2 changed files with 17 additions and 0 deletions

12
wutil.c
View file

@ -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;
}

View file

@ -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