Schreibe die Datei doch einfach über einen Stream:
Delphi-Quellcode:
procedure Save(CryptText: string; OutFileName: string);
var
FStream: TStream;
begin
ForceDirectories(ExtractFilePath(OutFileName)) ;
if FileExists(OutFileName) then
begin
FStream := TFileStream.Create(OutFileName,fmOpenReadWrite) ;
FStream.Seek(0,soFromEnd) ;
end
else
FStream := TFileStream.Create(OutFileName,fmCreate) ;
FStream .Write(Pointer(CryptText)^,Length(CryptText)* SizeOf(Char)) ;
FreeAndNil(FStream) ;
end;