Skip to content

Commit

Permalink
Add wrename wrapper around rename function
Browse files Browse the repository at this point in the history
darcs-hash:20061020223347-ac50b-1735f7e63b87f021ca71c44e5278726d3e8debc3.gz
  • Loading branch information
liljencrantz committed Oct 20, 2006
1 parent c0a5495 commit 8285242
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
12 changes: 12 additions & 0 deletions wutil.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
5 changes: 5 additions & 0 deletions wutil.h
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 8285242

Please sign in to comment.