From b10456a2642b63dfcdcb9f3c5e0c4f1bc6465566 Mon Sep 17 00:00:00 2001 From: mysticbbs Date: Sat, 7 Sep 2013 14:37:02 -0400 Subject: [PATCH] fileAppend --- mdl/m_fileio.pas | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/mdl/m_fileio.pas b/mdl/m_fileio.pas index b2b556a..9202fb7 100644 --- a/mdl/m_fileio.pas +++ b/mdl/m_fileio.pas @@ -35,6 +35,7 @@ Function FileCopy (Source, Target: String) : Boolean; Function FileFind (FN: String) : String; Function FileByteSize (FN: String) : Int64; Function FileNewExt (FN, NewExt: String) : String; +Procedure FileAppend (F1, F2: String); { GLOBAL FILEIO VARIABLES AND CONSTANTS } @@ -561,6 +562,39 @@ Begin Result := FN + '.' + NewExt; End; +Procedure FileAppend (F1, F2: String); +Var + BufIn, + BufOut : Array[1..8*1024] of Char; + TF1 : Text; + TF2 : Text; + Str : String; +Begin + Assign (TF1, F1); + + {$I-} Reset(TF1); {$I+} + + If IoResult <> 0 Then Exit; + + SetTextBuf (TF1, BufIn); + + Assign (TF2, F2); + {$I-} Append(TF2); {$I+} + + If (IoResult = 2) Then + ReWrite (TF2); + + SetTextBuf (TF2, BufOut); + + While Not Eof(TF1) Do Begin + ReadLn (TF1, Str); + WriteLn (TF2, Str); + End; + + Close (TF1); + Close (TF2); +End; + { FILE STREAMING FUNCTIONS } Constructor TFileBuffer.Create (BufferSize: LongInt);