ff:file
// --------------
assignfile(ff,'...')
{$I-} reset(ff,1);
if ioresult<>0 then rewrite(ff,1);
blockread(ff,buff,size,result);
blockwrite(ff,buff,size,result);
closefile(ff);
fi:integer
//------------
fi:=FileOpen(mmPath+cTamRecord,fmOpenReadWrite);
if fi=-1 then fi:=FileCreate(mmPath+cTamRecord);
result:=FileRead(fi,buff,size);
result:=filewrite(fi,buff,size);
fileclose(fi);