Question Julian Matthews · Jul 26, 2018

GlobalBinaryStream write to file on server

I have a process which is passed a .rtf within a GlobalBinaryStream. I am trying to then output just the .rtf to a folder on a server, but not even sure where to start.

Is there a Built in Operation that I can pass the GlobalBinaryStream to which will then write the file to a folder, or do I need to use a custom class for the operation?

Thanks 

Comments

Vitaliy Serdtsev · Jul 26, 2018

Working with Streams
E.g.

;s stream=##class(%GlobalBinaryStream).%New()
;d stream.Write("--------")
   
file=##class(%Stream.FileBinary).%New()
file.Filename="C:\temp\test.txt"
file.CopyFromAndSave(stream)
0
Julian Matthews  Jul 27, 2018 to Vitaliy Serdtsev

Thank you Vitaliy, not sure how I missed that in the documentation!

0