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 

  • 0
  • 0
  • 304
  • 1
  • 1

Answers

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)

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