static int wrap_fs_rename(struct _reent *r, char *oldpath, char *newpath) { #if 0 char tmpath[256]; if ((oldpath[0] != '/') && (oldpath[0] != '\\')) snprintf(tmpath, 256, "%s/%s", current_path, oldpath); else strcpy(tmpath, oldpath); normalize_path(tmpath); char tmpath1[256]; if ((newpath[0] != '/') && (newpath[0] != '\\')) snprintf(tmpath1, 256, "%s/%s", current_path, newpath); else strcpy(tmpath1, newpath); normalize_path(tmpath1); FF_ERROR error = FF_Move(pIoman, tmpath, tmpath1); if (!error) return 0; #endif r->_errno = EACCES; return -1; }
int move_cmd(int argc, char **argv, FF_ENVIRONMENT *pEnv) { FF_T_INT8 src[FF_MAX_PATH]; FF_T_INT8 dest[FF_MAX_PATH]; FF_ERROR Error; if(argc == 3) { ProcessPath(src, argv[1], pEnv); ProcessPath(dest, argv[2], pEnv); Error = FF_Move(pEnv->pIoman, src, dest); if(Error) { cons_printf("Error: %s\n", FF_GetErrMessage(Error)); } } else { cons_printf("Usage: %s [Source Path] [Destination Path]\n", argv[0]); } return 0; }