2 Copyright © 1995-2003, The AROS Development Team. All rights reserved.
5 ANSI C function rename().
15 #include <aros/debug.h>
17 /*****************************************************************************
29 Renames a file or directory.
32 oldpath - Complete path to existing file or directory.
33 newpath - Complete path to the new file or directory.
36 0 on success and -1 on error. In case of an error, errno is set.
48 ******************************************************************************/
50 char *aoldpath
= strdup(__path_u2a(oldpath
));
51 const char *anewpath
= __path_u2a(newpath
);
53 if (!Rename (aoldpath
, anewpath
))
56 errno
= IoErr2errno (ioerr
);
57 D(bug("rename(%s, %s) errno=%d, IoErr=%d\n", aoldpath
, anewpath
,