mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-26 12:53:13 +00:00
Add wrename wrapper around rename function
darcs-hash:20061020223347-ac50b-1735f7e63b87f021ca71c44e5278726d3e8debc3.gz
This commit is contained in:
parent
c0a54955e7
commit
8285242ff6
2 changed files with 17 additions and 0 deletions
12
wutil.c
12
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;
|
||||
}
|
||||
|
|
5
wutil.h
5
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
|
||||
|
|
Loading…
Reference in a new issue