Subversion Repositories spk

Rev

Rev 105 | Rev 125 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 105 Rev 121
Line 88... Line 88...
88
	}
88
	}
89
}
89
}
90
 
90
 
91
bool COriginalFiles::backupFile(C_File *f, CyStringList *errors)
91
bool COriginalFiles::backupFile(C_File *f, CyStringList *errors)
92
{
92
{
93
	Utils::String newDir = "PluginManager/Original/" + f->GetDirectory(NULL).ToString();
93
	Utils::String newDir = "PluginManager/Original/" + f->getDirectory(NULL);
94
	CDirIO oDir(_sDir);
94
	CDirIO oDir(_sDir);
95
	if ( oDir.Exists(newDir + "/" + f->GetFilename().ToString()) )
95
	if ( oDir.Exists(newDir + "/" + f->GetFilename().ToString()) )
96
		return true;
96
		return true;
97
 
97
 
98
	// make sure the directory exissts
98
	// make sure the directory exissts
99
	if ( !oDir.Exists(newDir) )
99
	if ( !oDir.exists(newDir) )
100
	{
100
	{
101
		if ( !oDir.Create(newDir) )
101
		if ( !oDir.Create(newDir) )
102
		{
102
		{
103
			CLog::logf(CLog::Log_Install, 2, "Unable to create directory to backup original files, %s", newDir.c_str());
103
			CLog::logf(CLog::Log_Install, 2, "Unable to create directory to backup original files, %s", newDir.c_str());
104
			AddLogEntry(SPKINSTALL_CREATEDIRECTORY_FAIL, newDir, errors);
104
			AddLogEntry(SPKINSTALL_CREATEDIRECTORY_FAIL, newDir, errors);
Line 365... Line 365...
365
}
365
}
366
 
366
 
367
void COriginalFiles::_storeOverride(C_File *f)
367
void COriginalFiles::_storeOverride(C_File *f)
368
{
368
{
369
	CDirIO oDir(_sDir + "/PluginManager/Original/Replacements");
369
	CDirIO oDir(_sDir + "/PluginManager/Original/Replacements");
370
	if ( !oDir.Exists() ) oDir.Create();
370
	if ( !oDir.exists() ) oDir.Create();
371
	CFileIO file(oDir.File(f->GetNameDirectory(NULL)));
371
	CFileIO file(oDir.file(f->GetNameDirectory(NULL).ToString()));
372
	if ( !file.GetDirIO().Exists() ) file.GetDirIO().Create();
372
	if ( !file.GetDirIO().exists() ) file.GetDirIO().Create();
373
	CFileIO fromFile(f->GetFilePointer());
373
	CFileIO fromFile(f->GetFilePointer());
374
	fromFile.copy(file.fullFilename(), true);
374
	fromFile.copy(file.fullFilename(), true);
375
}
375
}
376
 
376
 
377
}
377
}