Write in the same file many different times

poppinspoppins Member Posts: 647
edited 2015-05-08 in NAV Three Tier
Hi everyone,

I had a requirement from a customer where I have to create a log file for a batch treatment.
I used the following code to create and write in the file (for each execution, a file will be created):
LogFile.CREATETEMPFILE();
LogFile.TEXTMODE(TRUE);
LogFile.WRITE('xxx');
LogFile.CREATEINSTREAM(NewStream);
FileName := STRSUBSTNO(Textxxx,WORKDATE);
DOWNLOADFROMSTREAM(NewStream,'','<TEMP>', '',MagicPath);
CREATE(FileSystemObject,TRUE,TRUE);
FileSystemObject.CopyFile(MagicPath,FileName);
FileSystemObject.DeleteFile(MagicPath,TRUE);
The customer now wants to have a unique log file, meaning that the errors have to be appended each time in the same file.
How should I modify my code to get this requirement done?

Thanks in advance :mrgreen:
Sign In or Register to comment.