Beispiel #1
0
void devEthernet::loadCounters(std::map<std::string, xmlrpc_c::value>& cmap) {
	ACE_TRACE("devEthernet::loadCounters");
	MOD_DEBUG("Loading counters.\n");

	ACE_Dirent statDir;
	std::string msg, stat_path = _sysDir() + "/statistics";

	if ( statDir.open(stat_path.c_str()) == -1) {
		throw OperationFailed("Failed to open interface statistics directory " +
			stat_path + " for reading: " + std::string(ACE_OS::strerror(errno)));
	}

	int entrycount = 0;
	for (ACE_DIRENT *entry; (entry = statDir.read ()) != 0; entrycount++ ) {
		std::string entryname_(entry->d_name);

		if ( entryname_ == "." || entryname_ == ".." ) continue;

		std::string contents = read_one_liner(stat_path + "/entryname_");

		cmap[entryname_] = xmlrpc_c::value_int(ACE_OS::atoi(contents.c_str()));
	}

	statDir.close();

	switch (entrycount) {
    case 0:
		throw OperationFailed("Readdir failed to read anything.");
    case 1:
		throw OperationFailed("Readdir failed, only matched directory name.");
    }
}
Beispiel #2
0
void devEthernet::activate(const bool setupSocket /* = true */, const bool setFlags /* = true */) {
	ACE_TRACE("devEthernet::activate");
	MOD_DEBUG("Activating interface %s.", getIfaceName().c_str());

	checkProtection("activate");

	if ( _checkFlag(up) ) {
		MOD_WARNING("devEthernet::activate(): Device is already up.");
	}
	else {
		_setFlag(up, true); // IOCtlFailed is thrown if there's an error

		if ( ! _checkFlag(up) )
			throw OperationFailed("Failed to activate network interface " + getIfaceName() + ".");
	}

	if (setupSocket) openSocket();

	if (setFlags) _applyFlagsFromSettings();

	/*
	if ( static_cast<bool>(_promiscSetting) ) enablePromiscuous();
	else disablePromiscuous();

	if ( static_cast<bool>(_noArpSetting) ) disableARP();
	else enableARP();
	*/

}
Beispiel #3
0
int ERemoveDirectory(const string& Name,DIRDELTYPE Type)
{
	ProcessedItems++;
	string strFullName;
	ConvertNameToFull(Name,strFullName);

	bool Success = false;
	while(!Success)
	{
		switch(Type)
		{
		case D_DEL:
			Success = apiRemoveDirectory(Name) != FALSE;
			break;

		case D_WIPE:
			Success = WipeDirectory(Name) != FALSE;
			break;

		case D_RECYCLE:
			Success = RemoveToRecycleBin(Name) != FALSE;
			break;
		}

		if(!Success)
		{
			int MsgCode;

			if (SkipFoldersMode!=-1)
			{
				MsgCode=SkipFoldersMode;
			}
			else
			{
				MsgCode=OperationFailed(Name, MError, MSG(MCannotDeleteFolder));
			}

			switch (MsgCode)
			{
				case -1:
				case -2:
				case 3:
					return DELETE_CANCEL;
				case 1:
					return DELETE_SKIP;
				case 2:
					SkipFoldersMode=2;
					return DELETE_SKIP;
			}
		}
	}

	return DELETE_SUCCESS;
}
Beispiel #4
0
void devEthernet::deactivate() {
	ACE_TRACE("devEthernet::deactivate");

	if ( ! isInitialized() ) return;

	checkProtection("de-activate");

	closeSocket();

	_setFlag(up, false); // IOCtlFailed is thrown if there's an error

	if ( _checkFlag(up) )
		throw OperationFailed("Failed to deactivate network interface " +
			getIfaceName() + ".");
}
// ----------------------------------------------------------------------------
// Called if the operation fails.
// ----------------------------------------------------------------------------
void CContactMatcher::VPbkSingleContactOperationFailed(
    MVPbkContactOperationBase& /*aOperation*/, TInt aError)
    {
    OperationFailed( aError );
    }
// ----------------------------------------------------------------------------
// Called in case the find fails for some reason.
//
// @param aError One of the system wide error codes.
// ----------------------------------------------------------------------------
void CContactMatcher::FindFailed( TInt aError )
    {
    OperationFailed( aError );
    iResultContactLinkArray = NULL;
    }
void ShellMakeDir(Panel *SrcPanel)
{
	FarList ComboList={sizeof(FarList)};
	FarListItem LinkTypeItems[3]={};
	ComboList.ItemsNumber=ARRAYSIZE(LinkTypeItems);
	ComboList.Items=LinkTypeItems;
	ComboList.Items[0].Text=MSG(MMakeFolderLinkNone);
	ComboList.Items[1].Text=MSG(MMakeFolderLinkJunction);
	ComboList.Items[2].Text=MSG(MMakeFolderLinkSymlink);
	ComboList.Items[0].Flags|=LIF_SELECTED;

	#if 1
	//Maximus: поддержка "узких" дисплеев
	if (ScrX < 10)
	{
		_ASSERTE(ScrX>=10);
		return;
	}
	int BorderW = (72<(ScrX-1))?72:(ScrX-1); // 72
	int ElemW = BorderW - 2; // 70
	#endif

	FarDialogItem MkDirDlgData[]=
	{
		#if 1
		//Maximus: поддержка "узких" дисплеев
		{DI_DOUBLEBOX,3,1,BorderW,10,0,nullptr,nullptr,0,MSG(MMakeFolderTitle)},
		#else
		{DI_DOUBLEBOX,3,1,72,10,0,nullptr,nullptr,0,MSG(MMakeFolderTitle)},
		#endif
		{DI_TEXT,     5,2, 0,2,0,nullptr,nullptr,0,MSG(MCreateFolder)},
		#if 1
		//Maximus: поддержка "узких" дисплеев
		{DI_EDIT,     5,3,ElemW,3,0,L"NewFolder",nullptr,DIF_FOCUS|DIF_EDITEXPAND|DIF_HISTORY|DIF_USELASTHISTORY|DIF_EDITPATH,L""},
		#else
		{DI_EDIT,     5,3,70,3,0,L"NewFolder",nullptr,DIF_FOCUS|DIF_EDITEXPAND|DIF_HISTORY|DIF_USELASTHISTORY|DIF_EDITPATH,L""},
		#endif
		{DI_TEXT,    -1,4, 0,4,0,nullptr,nullptr,DIF_SEPARATOR,L""},
		{DI_TEXT,     5,5, 0,5,0,nullptr,nullptr,0,MSG(MMakeFolderLinkType)},
		#if 1
		//Maximus: поддержка "узких" дисплеев
		{DI_COMBOBOX,20,5,ElemW,5,0,nullptr,nullptr,DIF_DROPDOWNLIST|DIF_LISTNOAMPERSAND|DIF_LISTWRAPMODE,L""},
		#else
		{DI_COMBOBOX,20,5,70,5,0,nullptr,nullptr,DIF_DROPDOWNLIST|DIF_LISTNOAMPERSAND|DIF_LISTWRAPMODE,L""},
		#endif
		{DI_TEXT,     5,6, 0,6,0,nullptr,nullptr,0,MSG(MMakeFolderLinkTarget)},
		#if 1
		//Maximus: поддержка "узких" дисплеев
		{DI_EDIT,    20,6,ElemW,6,0,L"NewFolderLinkTarget",nullptr,DIF_DISABLE|DIF_EDITEXPAND|DIF_HISTORY|DIF_USELASTHISTORY|DIF_EDITPATH,L""},
		#else
		{DI_EDIT,    20,6,70,6,0,L"NewFolderLinkTarget",nullptr,DIF_DISABLE|DIF_EDITEXPAND|DIF_HISTORY|DIF_USELASTHISTORY|DIF_EDITPATH,L""},
		#endif
		{DI_CHECKBOX, 5,7, 0,7,Global->Opt->MultiMakeDir,nullptr,nullptr,0,MSG(MMultiMakeDir)},
		{DI_TEXT,    -1,8, 0,8,0,nullptr,nullptr,DIF_SEPARATOR,L""},
		{DI_BUTTON,   0,9, 0,9,0,nullptr,nullptr,DIF_DEFAULTBUTTON|DIF_CENTERGROUP,MSG(MOk)},
		{DI_BUTTON,   0,9, 0,9,0,nullptr,nullptr,DIF_CENTERGROUP,MSG(MCancel)},
	};
	auto MkDirDlg = MakeDialogItemsEx(MkDirDlgData);
	MkDirDlg[MKDIR_COMBOBOX_LINKTYPE].ListItems=&ComboList;
	std::vector<string> DirList;
	auto Dlg = Dialog::create(MkDirDlg, MkDirDlgProc, &DirList);
	#if 1
	//Maximus: поддержка "узких" дисплеев
	Dlg->SetPosition(-1,-1,BorderW+4,12);
	#else
	Dlg->SetPosition(-1,-1,76,12);
	#endif
	Dlg->SetHelp(L"MakeFolder");
	Dlg->SetId(MakeFolderId);
	Dlg->Process();

	if (Dlg->GetExitCode()==MKDIR_OK)
	{
		string strDirName=MkDirDlg[MKDIR_EDIT].strData;
		string strOriginalDirName;
		bool SkipAll = false;
		FOR(const auto& i, DirList)
		{
			// TODO: almost the same code in dirmix::CreatePath()

			strDirName = i;
			strOriginalDirName = strDirName;

			ConvertNameToFull(strDirName, strDirName);

			DeleteEndSlash(strDirName);
			bool bSuccess = false;

			size_t DirOffset = 0;
			ParsePath(strDirName, &DirOffset);
			string Part;
			Part.reserve(strDirName.size());

			for (size_t j = DirOffset; j <= strDirName.size(); ++j)
			{
				if (j == strDirName.size() || IsSlash(strDirName[j]))
				{
					Part = strDirName.substr(0, j);
					if (!os::fs::exists(Part) || j == strDirName.size()) // skip all intermediate dirs, but not last.
					{
						while(!(bSuccess=(os::CreateDirectory(Part, nullptr)!=FALSE)) && !SkipAll)
						{
							Global->CatchError();
							int Ret = OperationFailed(strOriginalDirName, MError, MSG(MCannotCreateFolder));
							if(Ret == 1) // skip
							{
								break;
							}
							else if(Ret == 2)
							{
								SkipAll = true;
								break;
							}
							else if (Ret < 0 || Ret == 3) // cancel
							{
								return;
							}
						}
						if(bSuccess)
						{
							TreeList::AddTreeName(Part);
						}
					}
				}
			}

			if (bSuccess)
			{
				if(MkDirDlg[MKDIR_COMBOBOX_LINKTYPE].ListPos)
				{
					string strTarget=MkDirDlg[MKDIR_EDIT_LINKPATH].strData;
					Unquote(strTarget);
					while(!CreateReparsePoint(strTarget, strDirName, MkDirDlg[MKDIR_COMBOBOX_LINKTYPE].ListPos==1?RP_JUNCTION:RP_SYMLINKDIR) && !SkipAll)
					{
						Global->CatchError();
						int Ret = OperationFailed(strDirName, MError, MSG(MCopyCannotCreateLink));
						if(Ret == 1) // skip
						{
							break;
						}
						else if(Ret == 2)
						{
							SkipAll = true;
							break;
						}
						else if (Ret < 0 || Ret == 3) // cancel
						{
							return;
						}
					}
				}
			}
		}
Beispiel #8
0
void ShellMakeDir(Panel *SrcPanel)
{
	FarList ComboList={sizeof(FarList)};
	FarListItem LinkTypeItems[3]={};
	ComboList.ItemsNumber=ARRAYSIZE(LinkTypeItems);
	ComboList.Items=LinkTypeItems;
	ComboList.Items[0].Text=MSG(MMakeFolderLinkNone);
	ComboList.Items[1].Text=MSG(MMakeFolderLinkJunction);
	ComboList.Items[2].Text=MSG(MMakeFolderLinkSymlink);
	ComboList.Items[0].Flags|=LIF_SELECTED;

	FarDialogItem MkDirDlgData[]=
	{
		{DI_DOUBLEBOX,3,1,72,10,0,nullptr,nullptr,0,MSG(MMakeFolderTitle)},
		{DI_TEXT,     5,2, 0,2,0,nullptr,nullptr,0,MSG(MCreateFolder)},
		{DI_EDIT,     5,3,70,3,0,L"NewFolder",nullptr,DIF_FOCUS|DIF_EDITEXPAND|DIF_HISTORY|DIF_USELASTHISTORY|DIF_EDITPATH,L""},
		{DI_TEXT,     0,4, 0,4,0,nullptr,nullptr,DIF_SEPARATOR,L""},
		{DI_TEXT,     5,5, 0,5,0,nullptr,nullptr,0,MSG(MMakeFolderLinkType)},
		{DI_COMBOBOX,20,5,70,5,0,nullptr,nullptr,DIF_DROPDOWNLIST|DIF_LISTNOAMPERSAND|DIF_LISTWRAPMODE,L""},
		{DI_TEXT,     5,6, 0,6,0,nullptr,nullptr,0,MSG(MMakeFolderLinkTarget)},
		{DI_EDIT,    20,6,70,6,0,L"NewFolderLinkTarget",nullptr,DIF_DISABLE|DIF_EDITEXPAND|DIF_HISTORY|DIF_USELASTHISTORY|DIF_EDITPATH,L""},
		{DI_CHECKBOX, 5,7, 0,7,Opt.MultiMakeDir,nullptr,nullptr,0,MSG(MMultiMakeDir)},
		{DI_TEXT,     0,8, 0,8,0,nullptr,nullptr,DIF_SEPARATOR,L""},
		{DI_BUTTON,   0,9, 0,9,0,nullptr,nullptr,DIF_DEFAULTBUTTON|DIF_CENTERGROUP,MSG(MOk)},
		{DI_BUTTON,   0,9, 0,9,0,nullptr,nullptr,DIF_CENTERGROUP,MSG(MCancel)},
	};
	MakeDialogItemsEx(MkDirDlgData,MkDirDlg);
	MkDirDlg[MKDIR_COMBOBOX_LINKTYPE].ListItems=&ComboList;
	UserDefinedList DirList(ULF_UNIQUE);
	Dialog Dlg(MkDirDlg,ARRAYSIZE(MkDirDlg),MkDirDlgProc,&DirList);
	Dlg.SetPosition(-1,-1,76,12);
	Dlg.SetHelp(L"MakeFolder");
	Dlg.SetId(MakeFolderId);
	Dlg.Process();

	if (Dlg.GetExitCode()==MKDIR_OK)
	{
		string strDirName=MkDirDlg[MKDIR_EDIT].strData;
		string strOriginalDirName;
		const wchar_t *OneDir;
		DirList.Reset();
		bool SkipAll = false;
		while (nullptr!=(OneDir=DirList.GetNext()))
		{
			strDirName = OneDir;
			strOriginalDirName = strDirName;

			//Unquote(DirName);
			if (Opt.CreateUppercaseFolders && !IsCaseMixed(strDirName))
				strDirName.Upper();

			DeleteEndSlash(strDirName,true);
			wchar_t* lpwszDirName = strDirName.GetBuffer();
			bool bSuccess = false;

			wchar_t *ChPtr;
			if(ParsePath(lpwszDirName, const_cast<const wchar_t **>(&ChPtr)) == PATH_UNKNOWN)
			{
				ChPtr = lpwszDirName;
			}

			for (; ; ChPtr++)
			{
				if (IsSlash(*ChPtr) || !*ChPtr)
				{
					WCHAR Ch=0;
					if(*ChPtr)
					{
						Ch = ChPtr[1];
						ChPtr[1] = 0;
					}
					if (*lpwszDirName)
					{
						string _strDirName(lpwszDirName);
						if (apiGetFileAttributes(_strDirName) == INVALID_FILE_ATTRIBUTES || !*ChPtr) // skip all intermediate dirs, but not last.
						{
							while(!(bSuccess=(apiCreateDirectory(_strDirName, nullptr)!=FALSE)) && !SkipAll)
							{
								int Ret = OperationFailed(strOriginalDirName, MError, MSG(MCannotCreateFolder));
								if(Ret == 1) // skip
								{
									break;
								}
								else if(Ret == 2)
								{
									SkipAll = true;
									break;
								}
								else if (Ret < 0 || Ret == 3) // cancel
								{
									return;
								}
							}
							if(bSuccess)
							{
								TreeList::AddTreeName(_strDirName);
							}
						}
					}
					if(*ChPtr)
					{
						ChPtr[1] = Ch;
					}
					else
					{
						break;
					}
				}
			}

			strDirName.ReleaseBuffer();

			if (bSuccess)
			{
				if(MkDirDlg[MKDIR_COMBOBOX_LINKTYPE].ListPos)
				{
					string strTarget=MkDirDlg[MKDIR_EDIT_LINKPATH].strData;
					Unquote(strTarget);
					while(!CreateReparsePoint(strTarget, strDirName, MkDirDlg[MKDIR_COMBOBOX_LINKTYPE].ListPos==1?RP_JUNCTION:RP_SYMLINKDIR) && !SkipAll)
					{
						int Ret = OperationFailed(strDirName, MError, MSG(MCopyCannotCreateLink));
						if(Ret == 1) // skip
						{
							break;
						}
						else if(Ret == 2)
						{
							SkipAll = true;
							break;
						}
						else if (Ret < 0 || Ret == 3) // cancel
						{
							return;
						}
					}
				}

				TreeList::AddTreeName(strDirName);
			}
		}

		SrcPanel->Update(UPDATE_KEEP_SELECTION);

		if (!strDirName.IsEmpty())
		{
			size_t pos;

			if (FindSlash(pos,strDirName))
				strDirName.SetLength(pos);

			if (!SrcPanel->GoToFile(strDirName) && strDirName.At(strDirName.GetLength()-1)==L'.')
			{
				strDirName.SetLength(strDirName.GetLength()-1);
				SrcPanel->GoToFile(strDirName);
			}
		}

		SrcPanel->Redraw();
		Panel *AnotherPanel=CtrlObject->Cp()->GetAnotherPanel(SrcPanel);
		int AnotherType=AnotherPanel->GetType();

		if (AnotherPanel->NeedUpdatePanel(SrcPanel) || AnotherType==QVIEW_PANEL)
		{
			AnotherPanel->Update(UPDATE_KEEP_SELECTION|UPDATE_SECONDARY);
			AnotherPanel->Redraw();
		}
	}
}
Beispiel #9
0
int FileViewer::ProcessKey(int Key)
{
	if (RedrawTitle && (((unsigned int)Key & 0x00ffffff) < KEY_END_FKEY || IsInternalKeyReal((unsigned int)Key & 0x00ffffff)))
		ShowConsoleTitle();

	if (Key!=KEY_F3 && Key!=KEY_IDLE)
		F3KeyOnly=false;

	switch (Key)
	{
#if 0
			/* $ 30.05.2003 SVS
			   Фича :-) Shift-F4 в редакторе/вьювере позволяет открывать другой редактор/вьювер
			   Пока закомментим
			*/
		case KEY_SHIFTF4:
		{
			if (!Opt.OnlyEditorViewerUsed)
				CtrlObject->Cp()->ActivePanel->ProcessKey(Key);

			return TRUE;
		}
#endif
		/* $ 22.07.2000 tran
		   + выход по ctrl-f10 с установкой курсора на файл */
		case KEY_CTRLF10:
		case KEY_RCTRLF10:
		{
			if (View.isTemporary())
			{
				return TRUE;
			}

			SaveScreen Sc;
			string strFileName;
			View.GetFileName(strFileName);
			CtrlObject->Cp()->GoToFile(strFileName);
			RedrawTitle = TRUE;
			return (TRUE);
		}
		// $ 15.07.2000 tran + CtrlB switch KeyBar
		case KEY_CTRLB:
		case KEY_RCTRLB:
			Opt.ViOpt.ShowKeyBar=!Opt.ViOpt.ShowKeyBar;

			if (Opt.ViOpt.ShowKeyBar)
				ViewKeyBar.Show();
			else
				ViewKeyBar.Hide0(); // 0 mean - Don't purge saved screen

			Show();
			KeyBarVisible = Opt.ViOpt.ShowKeyBar;
			return (TRUE);
		case KEY_CTRLSHIFTB:
		case KEY_RCTRLSHIFTB:
		{
			Opt.ViOpt.ShowTitleBar=!Opt.ViOpt.ShowTitleBar;
			TitleBarVisible = Opt.ViOpt.ShowTitleBar;
			Show();
			return (TRUE);
		}
		case KEY_CTRLO:
		case KEY_RCTRLO:

			if (!Opt.OnlyEditorViewerUsed)
			{
				if (FrameManager->ShowBackground())
				{
					SetCursorType(FALSE,0);
					WaitKey();
					FrameManager->RefreshFrame();
				}
			}

			return TRUE;
		case KEY_F3:
		case KEY_NUMPAD5:  case KEY_SHIFTNUMPAD5:

			if (F3KeyOnly)
				return TRUE;

		case KEY_ESC:
		case KEY_F10:
			FrameManager->DeleteFrame();
			return TRUE;
		case KEY_F6:

			if (!DisableEdit)
			{
				UINT cp=View.VM.CodePage;
				string strViewFileName;
				View.GetFileName(strViewFileName);
				File Edit;
				while(!Edit.Open(strViewFileName, FILE_READ_DATA, FILE_SHARE_READ|(Opt.EdOpt.EditOpenedForWrite?FILE_SHARE_WRITE:0), nullptr, OPEN_EXISTING, FILE_FLAG_SEQUENTIAL_SCAN))
				{
					if(!OperationFailed(strViewFileName, MEditTitle, MSG(MEditCannotOpen), false))
						continue;
					else
						return TRUE;
				}
				Edit.Close();
				__int64 FilePos=View.GetFilePos();
				DWORD flags = (GetCanLoseFocus()?FFILEEDIT_ENABLEF6:0)|(SaveToSaveAs?FFILEEDIT_SAVETOSAVEAS:0)|(DisableHistory?FFILEEDIT_DISABLEHISTORY:0);
				FileEditor *ShellEditor = new FileEditor(
					strViewFileName, cp, flags, -2,
					static_cast<int>(FilePos), // TODO: Editor StartChar should be __int64
					str_title.IsEmpty() ? nullptr: &str_title,
					-1,-1, -1, -1, delete_on_close );
				ShellEditor->SetEnableF6(TRUE);
				/* $ 07.05.2001 DJ сохраняем NamesList */
				ShellEditor->SetNamesList(View.GetNamesList());

				// Если переключаемся в редактор, то удалять файл уже не нужно
				SetTempViewName(L"");
				SetExitCode(0);

				FrameManager->DeleteFrame(this); // Insert уже есть внутри конструктора
				ShowTime(2);
			}

			return TRUE;

		case KEY_ALTSHIFTF9:
		case KEY_RALTSHIFTF9:
			// Работа с локальной копией ViewerOptions
			ViewerConfig(View.ViOpt, true);

			if (Opt.ViOpt.ShowKeyBar)
				ViewKeyBar.Show();

			View.Show();
			return TRUE;
		case KEY_ALTF11:
		case KEY_RALTF11:
			if (GetCanLoseFocus())
				CtrlObject->CmdLine->ShowViewEditHistory();

			return TRUE;
		default:
//      Этот кусок - на будущее (по аналогии с редактором :-)
//      if (CtrlObject->Macro.IsExecuting() || !View.ProcessViewerInput(&ReadRec))
		{
			/* $ 22.03.2001 SVS
			   Это помогло от залипания :-)
			*/
			if (!CtrlObject->Macro.IsExecuting())
				if (Opt.ViOpt.ShowKeyBar)
					ViewKeyBar.Show();

			if (!ViewKeyBar.ProcessKey(Key))
				return(View.ProcessKey(Key));
		}
		return TRUE;
	}
}
Beispiel #10
0
int ShellRemoveFile(const string& Name,int Wipe, int TotalPercent)
{
	ProcessedItems++;
	string strFullName;
	ConvertNameToFull(Name, strFullName);
	int MsgCode=0;

	for (;;)
	{
		if (Wipe)
		{
			if (SkipWipeMode!=-1)
			{
				MsgCode=SkipWipeMode;
			}
			else if (GetNumberOfLinks(strFullName)>1)
			{
				/*
				                            Файл
				                         "имя файла"
				                Файл имеет несколько жестких ссылок.
				  Уничтожение файла приведет к обнулению всех ссылающихся на него файлов.
				                        Уничтожать файл?
				*/
				MsgCode=Message(MSG_WARNING,5,MSG(MError),strFullName,
				                MSG(MDeleteHardLink1),MSG(MDeleteHardLink2),MSG(MDeleteHardLink3),
				                MSG(MDeleteFileWipe),MSG(MDeleteFileAll),MSG(MDeleteFileSkip),MSG(MDeleteFileSkipAll),MSG(MDeleteCancel));
			}

			switch (MsgCode)
			{
				case -1:
				case -2:
				case 4:
					return DELETE_CANCEL;
				case 3:
					SkipWipeMode=2;
				case 2:
					return DELETE_SKIP;
				case 1:
					SkipWipeMode=0;
				case 0:
					{
						bool Cancel = false;
						if (WipeFile(strFullName, TotalPercent, Cancel))
							return DELETE_SUCCESS;
						else if(Cancel)
							return DELETE_CANCEL;
					}
			}
		}
		else if (!Opt.DeleteToRecycleBin)
		{
			/*
			        HANDLE hDelete=FAR_CreateFile(Name,GENERIC_WRITE,0,nullptr,OPEN_EXISTING,
			               FILE_FLAG_DELETE_ON_CLOSE|FILE_FLAG_POSIX_SEMANTICS,nullptr);
			        if (hDelete!=INVALID_HANDLE_VALUE && CloseHandle(hDelete))
			          break;
			*/
			if (apiDeleteFile(strFullName))
				break;
		}
		else if (RemoveToRecycleBin(strFullName))
			break;

		if (SkipMode!=-1)
			MsgCode=SkipMode;
		else
		{
			MsgCode=OperationFailed(strFullName, MError, MSG(MCannotDeleteFile));
		}

		switch (MsgCode)
		{
			case -1:
			case -2:
			case 3:
				return DELETE_CANCEL;
			case 2:
				SkipMode=1;
			case 1:
				return DELETE_SKIP;
		}
	}

	return DELETE_SUCCESS;
}