Esempio n. 1
0
void InputFile::Update () {
    time_t newTime = UpdateTime(GetName());
    if (newTime > updateTime) {
        Reread();
        updateTime = newTime;
    }
}
FaerieAnimationsCollection::FaerieAnimationsCollection(std::string filename)
	: _filename(filename)
{
	Reread();
}
Esempio n. 3
0
int FTP::MakeDirectory(String& Name,int OpMode)
{
	PROC(("FTP::MakeDirectory",NULL))
	FTPHost h;

	if(!ShowHosts && !hConnect)
		return FALSE;

	h.Init();

//Edit name
	if(!IS_SILENT(OpMode) && !IS_FLAG(OpMode,OPM_NODIALOG) &&
	        !EditDirectory(Name, ShowHosts ? h.HostDescr : NULL, TRUE))
		return -1;

//Correct name
	if(!Name[0])
		return -1;

//HOSTS
	if(ShowHosts)
	{
		if(Name.Cmp(".")  ||
		        Name.Cmp("..") ||
		        FTPHost::CheckHost(HostsPath, Name.c_str()))
		{
			SetLastError(ERROR_ALREADY_EXISTS);
			return FALSE;
		}

		char str[MAX_PATH];
		h.Folder = TRUE;
		StrCpy(h.Host, Name.c_str(), ARRAYSIZE(h.Host));
		h.MkINIFile(str,NULL,"");
		StrCpy(h.Host, str, ARRAYSIZE(h.Host));
		h.Write(HostsPath);
		SelectFile=Name;
		return TRUE;
	}

//FTP
	FP_Screen   scr;

	//Create directory
	do
	{
		//Try to create
		if(hConnect &&
		        FTPCreateDirectory(Name.c_str(), OpMode))
			return TRUE;

		//If conection alive - report error
		if(FtpCmdLineAlive(hConnect) ||
		        IS_SILENT(OpMode))
			return FALSE;

		//Try to reconnect
		if(!Reread())
			return FALSE;

		//Repeat operation
	}
	while(true);
}