mirror of
https://github.com/reactos/reactos.git
synced 2025-04-20 12:29:56 +00:00
27 lines
402 B
C
27 lines
402 B
C
#include <windows.h>
|
|
#include <msvcrt/stdio.h>
|
|
#include <msvcrt/io.h>
|
|
|
|
|
|
int rename(const char *old_, const char *new_)
|
|
{
|
|
if (old_ == NULL || new_ == NULL)
|
|
return -1;
|
|
|
|
if (!MoveFileA(old_,new_))
|
|
return -1;
|
|
|
|
return 0;
|
|
}
|
|
|
|
int _wrename(const wchar_t *old_, const wchar_t *new_)
|
|
{
|
|
if (old_ == NULL || new_ == NULL)
|
|
return -1;
|
|
|
|
if (!MoveFileW(old_,new_))
|
|
return -1;
|
|
|
|
return 0;
|
|
}
|
|
|