Forum Discussion

NewManLiving's avatar
12 years ago

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

2 Replies

  • "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