Object Pascal
Result := Sr.Size
else Result := -1;
end;
Function FileDateTime(const FileName: string): System.TDateTime;
{время создания файла FileName, например:
s:= DateTimeToStr(FileDateTime('c:KdnBreadBread.exe'))}
begin
Result := FileDateToDateTime(FileAge(FileName));
end;
Function HasAttr(const FileName: string; Attr: Word): Boolean;
{имеет ли файл FileName атрибут Attr}
begin
Result := (FileGetAttr(FileName) and Attr) = Attr;
end;
Procedure AppendText(Var f: Text; nF: String);
{открывает текстовой файл для добавления строк}
begin
Assign(f,nF);
if KdnFS(nF,1)>0 then Append(f) else Rewrite(f);
end;
Procedure AppendToText(nF,s: String);
{добавляет строку в конец текстового файла}
Var f: TextFile;
begin
AppendText(f, nF);
Writeln(f,s);
CloseFile(f);
end;
Procedure KdnExec(Command: String);
{запуск другого приложения, например 'c:KdnBreadDirKdnBread.exe'}
begin
Serv:=Command+#0;
If WinExec(@Serv[1], SW_SHOWNORMAL)