Linux getting rid of Carriage Return when file is being written out by intersystems cache

205 views Asked by At

Working with Intersystems cache and writing a file out to a unix server and upon opening in WordPad++ the Carriage return is missing but the Line feed is still there. Our process works in windows but for some reason not in Unix.

1

There are 1 answers

0
DAiMor On

You can just manually set LineTerminator, which is by default for UNIX systems only $c(10)

set fs = ##class(%File.Character.Stream).%New()
set fs.Filename = "/tmp/somefilename"
set fs.LineTerminator = $c(13,10)
do fs.WriteLine("Text Line 1")
do fs.WriteLine("Text Line 2")