#include "mysys_priv.h"#include <my_dir.h>#include "mysys_err.h"Include dependency graph for my_rename.c:

Go to the source code of this file.
Functions | |
| int | my_rename (const char *from, const char *to, myf MyFlags) |
| int my_rename | ( | const char * | from, | |
| const char * | to, | |||
| myf | MyFlags | |||
| ) |
Definition at line 24 of file my_rename.c.
References DBUG_ENTER, DBUG_PRINT, DBUG_RETURN, EE_LINK, errno, error, ME_BELL, ME_WAITTANG, my_delete(), my_errno, my_error(), MY_FAE, my_stat(), MY_STAT, MY_WME, and MYF.
00025 { 00026 int error = 0; 00027 DBUG_ENTER("my_rename"); 00028 DBUG_PRINT("my",("from %s to %s MyFlags %d", from, to, MyFlags)); 00029 00030 #if defined(HAVE_FILE_VERSIONS) 00031 { /* Check that there isn't a old file */ 00032 int save_errno; 00033 MY_STAT my_stat_result; 00034 save_errno=my_errno; 00035 if (my_stat(to,&my_stat_result,MYF(0))) 00036 { 00037 my_errno=EEXIST; 00038 error= -1; 00039 if (MyFlags & MY_FAE+MY_WME) 00040 my_error(EE_LINK, MYF(ME_BELL+ME_WAITTANG),from,to,my_errno); 00041 DBUG_RETURN(error); 00042 } 00043 my_errno=save_errno; 00044 } 00045 #endif 00046 #if defined(HAVE_RENAME) 00047 #if defined(__WIN__) || defined(__NETWARE__) 00048 /* 00049 On windows we can't rename over an existing file: 00050 Remove any conflicting files: 00051 */ 00052 (void) my_delete(to, MYF(0)); 00053 #endif 00054 if (rename(from,to)) 00055 #else 00056 if (link(from, to) || unlink(from)) 00057 #endif 00058 { 00059 my_errno=errno; 00060 error = -1; 00061 if (MyFlags & (MY_FAE+MY_WME)) 00062 my_error(EE_LINK, MYF(ME_BELL+ME_WAITTANG),from,to,my_errno); 00063 } 00064 DBUG_RETURN(error); 00065 } /* my_rename */
Here is the call graph for this function:

1.4.7
