PDA上的CF CARD 文件系统的建立程式

源代码在线查看: rename.c

软件大小: 784 K
上传用户: xiao11tian
关键词: CARD PDA 文件系统 程式
下载地址: 免注册下载 普通下载 VIP

相关代码

				/*************************************************************
				File Name: rename.C                                          *
				**************************************************************
				Programmer: MSC
				Last Modified Date: 2000/02/26
				Compiler : GNU Cross-compiler/SDS
				Platform : X86 protection mode, MIPS, Dragonball
				Usage :
					int rename(const char *oldname, const char *newname)
				*************************************************************/
				
				/*************************************************************
				 		  	Header Files
				**************************************************************/
				#include 
				//#include "myansi.h"
				#include 
				#include 
				
				
				
				#ifdef RAMDISK_ID
				
				
				
				/* basic.c */
				extern int		InitRD;
				//extern int		RDerrno;
				extern int		RD_SemaphoreID;
				
				/* fio.c */
				extern struct RD_FILE **RD_HandleTable;
				#ifdef CURRENT_DIR_ENABLE
					extern unsigned char RD_CurrentPathname[MAX_PATH_LENGTH];
				#endif
				
				
				/*************************************************************
				Function: RD_rename(oldname, newname)
				Description:
					rename an existing file/dir
				Input:
					oldname - old file/dir name
					newname - new file/dir name
				Output:
					0:  Success
					-1: Failure
				Note:	oldname/newname can't be '\\'(root)
					newname can't be duplicated
				**************************************************************/
				int RD_rename(unsigned char *oldname, unsigned char *newname)
				{
				  int status;
				
				  if (InitRD == FALSE)
				  {
					RDerrno = ERROR_FILE_SYSTEM_NOT_INIT;
					return -1;
				  }
				
				  sc_waitSemaphore(RD_SemaphoreID);
				
				  status = RD_rename_r(oldname, newname);
				
				  sc_signalSemaphore(RD_SemaphoreID);
				
				  return status;
				}
				
				
				
				/*************************************************************
				Function: RD_rename_r(oldname, newname)
				Description:
					rename an existing file/dir
				Input:
					oldname - old file/dir name
					newname - new file/dir name
				Output:
					0:  Success
					-1: Failure
				Note:	oldname/newname can'be '\\'(root)
					newname can't be duplicated
				ThreadSafe:
				**************************************************************/
				/* 虫			

相关资源