5bool HDD_Rename(
const char *FileName,
const char *NewFileName)
10 char OldName[512], NewName[512];
17 if(FileName && FileName[0] && NewFileName && NewFileName[0] &&
HDD_Exist(FileName))
23 ret = (rename(OldName, NewName) == 0);
30 TAP_SPrint(OldName,
"%s%s-%d%s.inf%s", Path, Name, fNumber, Ext, isDel ?
".del" :
"");
32 TAP_SPrint(OldName,
"%s%s%s.inf%s", Path, Name, Ext, isDel ?
".del" :
"");
36 TAP_SPrint(NewName,
"%s%s-%d%s.inf%s", Path, Name, fNumber, Ext, isDel ?
".del" :
"");
38 TAP_SPrint(NewName,
"%s%s%s.inf%s", Path, Name, Ext, isDel ?
".del" :
"");
40 rename(OldName, NewName);
45 TAP_SPrint(OldName,
"%s%s-%d%s.nav%s", Path, Name, fNumber, Ext, isDel ?
".del" :
"");
47 TAP_SPrint(OldName,
"%s%s%s.nav%s", Path, Name, Ext, isDel ?
".del" :
"");
51 TAP_SPrint(NewName,
"%s%s-%d%s.nav%s", Path, Name, fNumber, Ext, isDel ?
".del" :
"");
53 TAP_SPrint(NewName,
"%s%s%s.nav%s", Path, Name, Ext, isDel ?
".del" :
"");
55 rename(OldName, NewName);
60 TAP_SPrint(OldName,
"%s%s-%d.cut%s", Path, Name, fNumber, isDel ?
".del" :
"");
62 TAP_SPrint(OldName,
"%s%s.cut%s", Path, Name, isDel ?
".del" :
"");
66 TAP_SPrint(NewName,
"%s%s-%d.cut%s", Path, Name, fNumber, isDel ?
".del" :
"");
68 TAP_SPrint(NewName,
"%s%s.cut%s", Path, Name, isDel ?
".del" :
"");
70 rename(OldName, NewName);
75 TAP_SPrint(OldName,
"%s%s-%d.cut.bak%s", Path, Name, fNumber, isDel ?
".del" :
"");
77 TAP_SPrint(OldName,
"%s%s.cut.bak%s", Path, Name, isDel ?
".del" :
"");
81 TAP_SPrint(NewName,
"%s%s-%d.cut.bak%s", Path, Name, fNumber, isDel ?
".del" :
"");
83 TAP_SPrint(NewName,
"%s%s.cut.bak%s", Path, Name, isDel ?
".del" :
"");
85 rename(OldName, NewName);
89 Name[strlen(Name) - 4] =
'\0';
91 TAP_SPrint(OldName,
"%s%s-%d.srt%s", Path, Name, fNumber, isDel ?
".del" :
"");
93 TAP_SPrint(OldName,
"%s%s.srt%s", Path, Name, isDel ?
".del" :
"");
96 Name[strlen(Name) - 4] =
'\0';
98 TAP_SPrint(NewName,
"%s%s-%d.srt%s", Path, Name, fNumber, isDel ?
".del" :
"");
100 TAP_SPrint(NewName,
"%s%s.srt%s", Path, Name, isDel ?
".del" :
"");
102 rename(OldName, NewName);
void ConvertPathType(const char *Source, char *Dest, tPathFormat DestFormat)
bool HDD_Exist(const char *FileName)
bool HDD_Rename(const char *FileName, const char *NewFileName)
void MakeUniqueFileName(char *FileName)
void SeparateFileNameComponents(const char *FileName, char *Path, char *Name, char *Ext, int *Index, bool *isRec, bool *isDel)