ObjectScript - Appending to a file from another
– I want to “copy” a file to another, appending if the file already exists. The below code works, except it overwrites the new file, rather than append. The documentation says CopyFile will append
//Both files exists, so we can combine them
set tsc=##class(%File).CopyFile("D:\Files\Out\Vigilanz\AD_Lawson10132020.txt","D:\Files\Out\Vigilanz\employee10132020.txt"
if $$$ISOK(tsc)
{
W !, "SQL file copied"
}
else
{
Quit $$$ERROR($$$GeneralError,"SQL file not copied: "_SQLFileDate_" to "_EmployeeFile)
}
Thanks, Nora