Roku Developer Program

Join our online forum to talk to Roku developers and fellow channel creators. Ask questions, share tips with the community, and find helpful resources.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
ogai_p
Visitor

How to write using WriteAsciiFile?

Hi,

Using this function writes to a temporary file that disappears when my channel is closed:
WriteAsciiFile("tmp:/config.txt", "the text to write")

What filepath should I use so that the data I write still exists once my channel is closed then reopened?

Thanks in advance!
0 Kudos
4 REPLIES 4
gonzotek
Visitor

Re: How to write using WriteAsciiFile?

"ogai_p" wrote:
Hi,

Using this function writes to a temporary file that disappears when my channel is closed:
WriteAsciiFile("tmp:/config.txt", "the text to write")

What filepath should I use so that the data I write still exists once my channel is closed then reopened?

Thanks in advance!
You can't write anything permanent to the filesystem(s) on Roku. You can store data in the registry. See roRegistry and roRegistrySection entries in the Component Reference pdf of the sdk. You can store a max of 16KB data. Once you store data into the registry it persists until you overwrite it, the channel is removed by the user, or the player is reset to factory defaults.
Remoku.tv - A free web app for Roku Remote Control!
Want to control your Roku from nearly any phone, computer or tablet? Get started at http://help.remoku.tv
by Apps4TV - Applications for television and beyond: http://www.apps4tv.com
0 Kudos
destruk
Binge Watcher

Re: How to write using WriteAsciiFile?

For persistent extra storage, you can write a file like you're doing, and save it off to a web server. However, there is no way to check for a home button press when the channel exits - so you can't count on the data being saved 100%. It's annoying to not have a clean program termination or time to do housekeeping prior to that condition.
0 Kudos
TheEndless
Channel Surfer

Re: How to write using WriteAsciiFile?

"destruk" wrote:
For persistent extra storage, you can write a file like you're doing, and save it off to a web server. However, there is no way to check for a home button press when the channel exits - so you can't count on the data being saved 100%. It's annoying to not have a clean program termination or time to do housekeeping prior to that condition.

They used to have that functionality prior to firmware 2.6, but changed it to prevent poorly written channels from locking up the box: viewtopic.php?f=34&t=28472&p=179882#p179882
My Channels: http://roku.permanence.com - Twitter: @TheEndlessDev
Instant Watch Browser (NetflixIWB), Aquarium Screensaver (AQUARIUM), Clever Clocks Screensaver (CLEVERCLOCKS), iTunes Podcasts (ITPC), My Channels (MYCHANNELS)
0 Kudos
destruk
Binge Watcher

Re: How to write using WriteAsciiFile?

Yeah I remember - but since every public channel must be approved for public consumption, they 'could' change it back. And channels still lock up the box due to internal and secondary bugs with channel code and components, so .... I'm looking at you HULU! HA...
0 Kudos