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: 
NewManLiving
Visitor

Specifics on writing to temp

This probably is on a thread somewhere but I was unable to find it.
I need to know the guidelines for writing to the temp directory.
Is the size fixed or dynamically allocated. Can another system thread overwrite
data stored there by a currently running application. Can another
Component of the running application overwrite space a already
Allocated to a lower stacked component. Thanks for all your help
My Channels: 2D API Framework Presentation: https://owner.roku.com/add/2M9LCVC
Updated: 11-11-2015 - Completed Keyboard interface
The Joel Channel ( Final Beta )
0 Kudos
2 REPLIES 2
RokuJoel
Binge Watcher

Re: Specifics on writing to temp

"NewManLiving" wrote:
Is the size fixed or dynamically allocated.


Dynamic - depends on how many channels you have installed, the size of those channels and size of the device's firmware. If you wanted to test, you could keep writing files until you get a response of false. For example, using copyfile, keep duplicating a file with a different name of course) until copyfile stops returning true. (or, the device reboots :shock:)

Can another system thread overwrite
data stored there by a currently running application.


Only a screensaver that is signed with the same DeveloperID as your channel can write to or read from the tmp:/ area when your channel is running.

Can another Component of the running application overwrite space already
Allocated to a lower stacked component.


Any part of your program that writes to tmp:/ could theoretically overwrite or delete a file that you have written in another section of your program. However, to rewrite a file with the same name, you have to call deletefile("tmp:/filename") first, so that offers a little bit of protection. Best would be to keep track of the files you are storing in an array that is globally available.

- Joel
0 Kudos
NewManLiving
Visitor

Re: Specifics on writing to temp

Thanks Joel. That works for me
My Channels: 2D API Framework Presentation: https://owner.roku.com/add/2M9LCVC
Updated: 11-11-2015 - Completed Keyboard interface
The Joel Channel ( Final Beta )
0 Kudos
Need Assistance?
Welcome to the Roku Community! Feel free to search our Community for answers or post your question to get help.

Become a Roku Streaming Expert!

Share your expertise, help fellow streamers, and unlock exclusive rewards as part of the Roku Community. Learn more.