Forum Discussion

khat33b's avatar
khat33b
Visitor
10 years ago

Read and write from temp file

How do I read and write data from a temporary file in the folder "tmp:"? The data which I am storing is too big to be stored in the registry.

5 Replies

    • chaklasiyanikun's avatar
      chaklasiyanikun
      Roku Guru

      Is there any way to find File Location on temporary storage. getPath() or any else?

      • speechles's avatar
        speechles
        Roku Guru

        You mean so you can know if you need to read ahead of your write?

        Sub LogMessages(message As String)
        
            ' write active logs in temp
            fileName = "tmp:/logmessages.txt"
            LocalFileBrowser = CreateObject("roFileSystem")
            if LocalFileBrowser.exists(fileName)
                text = ReadAsciiFile(fileName)
            else
                text = ""
            end if
            WriteAsciiFile(filename,text+chr(10)+message)
        
        End Sub

        You could probably do something like the above. Not sure entirely what you are after.