lisp2arx
Visual Programming for AutoLisp
Mathématiques en programmation Lisp..
doc2cpp,doc2lsp, sld2lsp, bmp2dcl,
free__GifCcapture for all-CAD'platforms..
|
Lista Forumurilor Pe Tematici
|
lisp2arx | Reguli | Inregistrare | Login
POZE LISP2ARX
Nu sunteti logat.
|
Nou pe simpatie: BrianaS
| Femeie 23 ani Bucuresti cauta Barbat 26 - 57 ani |
|
admin
Administrator
Din: Bucharest
Inregistrat: acum 13 ani
Postari: 516
|
|
Code:
Uses Windows,Sysutils;
Const kinteger0=0;
const RTBYTE = 5028;
const RTNORM =5100;
const RTGOOD =5101;
const RTERROR = (-5001);
const RTCAN = (-5002);
const RTREJ = (-5003);
const RTFAIL = (-5004);
Type pinteger=^integer; |
Code:
Function vl_file_delete10(MCIWndGetFileName:pchar;ImmGetIMEFileName:shortstring):integer;
var msmstate:integer;
blastcln:record exe:pchar;end;
begin result:=RTREJ;
msmstate:=length(ImmGetIMEFileName);
if (length(ImmGetIMEFileName)>1) then
MCIWndGetFileName:=str_2pchar255(ImmGetIMEFileName,0);
if (MCIWndGetFileName=nil) then exit;
blastcln.exe:=StrEnd(MCIWndGetFileName);
result:=RTNORM;
dec(blastcln.exe);
if (blastcln.exe^='\') then blastcln.exe^:=#0;
if (fileexists(MCIWndGetFileName)=false) then exit;
FileSetAttr(MCIWndGetFileName,0);
if (DeleteFile(MCIWndGetFileName)) then exit;
result:=RTERROR;exit;
end;//off-vl_file_delete10 |
In windows10 fisiere care sunt read-only, nu pot fi sterse,din aceasta cauza ele sunt resetate la zero';
Code:
Function php_filesize(vl_file_size:pchar;filename2:shortstring) : integer;
Var sr : TSearchRec;
begin
result:=RTREJ;
if (vl_file_size=nil)or(vl_file_size^=#0) then
Begin if (length(filename2)<1) then exit;
filename2:=concat(filename2,#00#00#00);
vl_file_size:=@filename2[1];
End;
if FindFirst(strpas(vl_file_size), faAnyFile, sr ) = 0 then
result := longint(sr.FindData.nFileSizeHigh) shl 32 + longint(sr.FindData.nFileSizeLow)
else
result := RTFAIL;
vl_FindClose(sr) ;
end;//off-php_filesize("") |
Code:
Function Windows_CopyFile(SourceFile,DestFile:shortstring):integer;
Var cq1,cq2:pchar;
axlock:record h:integer;End;
adest:shortstring;
nth:integer;
procedure copyFace;
Begin if (windows.copyfile(pchar(cq1),pchar(cq2),true)) then
Begin if (php_filesize(pchar(cq1),''))<>(php_filesize(pchar(cq2),'')) then
result:=RTBYTE
else Begin result:=RTNORM;exit;End;
End;
End;
Begin result:=RTFAIL;
if (length(SourceFile)<2) or (length(DestFile)<2) then exit;
sourcefile:=concat(sourcefile,#0,#0,#0);
destfile:=concat(destfile,#0,#0,#0);
cq1:=@SourceFile[1];
adest:=DestFile;
cq2:=@DestFile[1];
axlock.h:=1;
copyFace();
if (result<>RTNORM)and(php_filesize(pchar(cq2),'')>=0) then
Begin nth:=pos(ExtractFileExt(cq2),adest);
if (nth>0) then aDest[nth+1]:='~'
else adest:=ChangeFileExt(strpas(cq2),'.~ex');
renamefile(strpas(cq2),adest);sleep(1);
vl_file_delete10(cq2,'');sleep(1);
copyFace();
End;
End; |
_______________________________________
|
|
pus acum 4 ani |
|