Search code examples
editorfile-typerealbasic

Creating a file of a certain type with Real Studio


I am making an editor with Real Studio for a special kind of file type. I made the file type with the File Type Editor, but how can I make a file output stream for that file type? Currently I am using:

DIM f AS FolderItem
DIM t AS TextOutputStream
f = GetFolderItem(fileName)
t = TextOutputStream.Create(f)
t.Write theData
t.Close

But that doesn't create a file openable by my editor. I am looking for something like this:

DIM f AS FolderItem
DIM t As FileTypes1.MyFileType.OutputStream
f = GetFolderItem(fileName)
t = FileTypes1.MyFileType.OutputStream.Create(f)
t.Write theData
t.Close

Solution

  • I just added this to my code:

    f.MacCreator = FileTypes1.MyFileType.MacCreator
    f.MacType = FileTypes1.MyFileType.MacType
    

    so that my application recognizes the files.