khat33b
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-30-2015
04:15 AM
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 5
destruk
Streaming Star
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-30-2015
07:22 AM
Re: Read and write from temp file
data=ReadAsciiFile("tmp:/example.txt")
WriteAsciiFile("tmp:/example.txt", data)
http://sdkdocs.roku.com/display/sdkdoc/ ... ngasString
WriteAsciiFile("tmp:/example.txt", data)
http://sdkdocs.roku.com/display/sdkdoc/ ... ngasString

RokuMarkn
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-30-2015
08:05 AM
Re: Read and write from temp file
Note however that the temp filesystem doesn't persist when your channel is closed. See http://sdkdocs.roku.com/display/sdkdoc/File+System
--Mark
--Mark
chaklasiyanikun
Roku Guru
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-03-2020
03:18 AM
Re: Read and write from temp file
Is there any way to find File Location on temporary storage. getPath() or any else?

speechles
Roku Guru
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-03-2020
07:14 AM
Re: Read and write from temp file
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.
chaklasiyanikun
Roku Guru
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-03-2020
10:53 PM
Re: Read and write from temp file
Here I tried to find a file path like a tree structure. In package storage, I created a one folder image and inside an image folder stored 1.txt file and I tried to find my file Location like a pkg:/images/1.txt using only file name 1.txt.