Code:
Function vl_file_echoipx(file1Name:pchar;file2name:shortstring;Const AcutNewBuffer:string;howmany24:integer;evalMode:char):integer;
Var size:record h:integer;End;
DestF:h_ino_fileclass.TFile;
Begin
result:=RTCAN;
if (evalMode='D')and(file1name<>nil) then
Begin vl_file_delete10(file1name,'');evalMode:='W';End else
if (evalMode='D')and(file2name<>'') then
Begin vl_file_delete10(nil,file2name);evalMode:='W';End ;
if (file1Name=nil) and (file2name<>'') then
size.h:=php_filesize(@file2Name[1],length(file2Name));
if (file1Name<>nil) then size.h:=php_filesize(file1Name,0);
result:=RTNORM;
if (evalMode='W') and (size.h>=0) then
begin if (file1name<>nil) then vl_file_delete10(nil,strpas(file1name)) else
if (file2name<>'') then vl_file_delete10(nil,file2name);
size.h:=RTCAN;
end;
if (evalMode='W') or (size.h<0) then
Begin if (length(file2name)>3)
then vl_file_forcedirectories(@file2name[1],length(file2name),true)
else if (file1Name<>nil) then vl_file_forcedirectories(file1Name,0,fat);
if (file1Name=nil)or(file1name^=#0)
then DestF:=TFile.Create(file2name ,fdCreateAlways, faWrite, fsNone)
else DestF:=TFile.Create(strpas(file1name),fdCreateAlways, faWrite, fsNone);
result:=RTNORM;
Try DestF.WriteAnsiString(AcutNewBuffer);
Except result:=RTFAIL;
End;
DestF.free;
DestF:=nil;
exit;
End;
if (file1Name=nil)or(file1name^=#0)
then DestF:=TFile.Create(file2name ,fdOpenExisting,faReadWrite,fsRead)
else DestF:=TFile.Create(strpas(file1name),fdOpenExisting,faReadWrite,fsRead);
result:=RTNORM;
Try
DestF.SeekToEnd();
DestF.WriteAnsiString(acutNewBuffer);
Except result:=RTFAIL;;End;
DestF.free;
asm xor eax,eax
mov [destF],eax
end;
End;//off-vl_file_echoipx("Atentie!mare trebuie W cu litere mari si nu mici.") |