unit hiFileTools;
interface
uses Kol,Share,windows,Debug;
type
THIFileTools = class(TDebug)
private
public
_prop_DelToRecycle:byte;
_data_NewFileName:THI_Event;
_data_FileName:THI_Event;
_event_onEnd:THI_Event;
procedure _work_doMove(var _Data:TData; Index:word);
procedure _work_doCopy(var _Data:TData; Index:word);
procedure _work_doDelete(var _Data:TData; Index:word);
procedure _work_doFileExists(var _Data:TData; Index:word);
end;
implementation
procedure THIFileTools._work_doMove;
var
F1,F2:string;
begin
F1 := ReadString(_Data,_data_FileName,');
F2 := ReadString(_Data,_data_NewFileName,');
MoveFile(PChar(F1),PChar(F2));
if FileExists(F2) then
_hi_OnEvent(_event_onEnd);
end;
procedure THIFileTools._work_doCopy;
var
F1,F2:string;
begin
F1 := ReadString(_Data,_data_FileName,');
F2 := ReadString(_Data,_data_NewFileName,');
CopyFile(PChar(F1),PChar(F2),false);
if FileExists(F2) then
_hi_OnEvent(_event_onEnd);
end;
procedure THIFileTools._work_doDelete;
var F1:string;
begin
F1 := ReadString(_Data,_data_FileName,');
if _prop_DelToRecycle = 0 then
DeleteFile2Recycle(f1)
else DeleteFile(PChar(F1));
if not FileExists(F1) then
_hi_OnEvent(_event_onEnd);
end;
procedure THIFileTools._work_doFileExists;
begin
if FileExists(ReadString(_Data,_data_FileName,')) then
_hi_OnEvent(_event_onEnd,1)
else _hi_OnEvent(_event_onEnd,0);
end;
end.
unit hiFileTools;
interface
uses Kol,Share,windows,Debug;
type
THIFileTools = class(TDebug)
private
public
_prop_DelToRecycle:byte;
_data_NewFileName:THI_Event;
_data_FileName:THI_Event;
_event_onEnd:THI_Event;
procedure _work_doMove(var _Data:TData; Index:word);
procedure _work_doCopy(var _Data:TData; Index:word);
procedure _work_doDelete(var _Data:TData; Index:word);
procedure _work_doFileExists(var _Data:TData; Index:word);
end;
implementation
procedure THIFileTools._work_doMove;
var
F1,F2:string;
begin
F1 := ReadString(_Data,_data_FileName,');
F2 := ReadString(_Data,_data_NewFileName,');
MoveFile(PChar(F1),PChar(F2));
if FileExists(F2) then
_hi_OnEvent(_event_onEnd);
end;
procedure THIFileTools._work_doCopy;
var
F1,F2:string;
begin
F1 := ReadString(_Data,_data_FileName,');
F2 := ReadString(_Data,_data_NewFileName,');
CopyFile(PChar(F1),PChar(F2),false);
if FileExists(F2) then
_hi_OnEvent(_event_onEnd);
end;
procedure THIFileTools._work_doDelete;
var F1:string;
begin
F1 := ReadString(_Data,_data_FileName,');
if _prop_DelToRecycle = 0 then
DeleteFile2Recycle(f1)
else DeleteFile(PChar(F1));
if not FileExists(F1) then
_hi_OnEvent(_event_onEnd);
end;
procedure THIFileTools._work_doFileExists;
begin
if FileExists(ReadString(_Data,_data_FileName,')) then
_hi_OnEvent(_event_onEnd,1)
else _hi_OnEvent(_event_onEnd,0);
end;
end.
Ответов: 2058
Рейтинг: 28
|
|||
Galkov, там нет вообще такого, вот мой hiFileTools
|
|||
карма: 1 |
|