Read and write from temp file in Roku

半腔热情 提交于 2020-01-14 09:22:06

问题


In Roku, how do I read and write data from a temporary file in the folder tmp:? I cannot find any documentation relating to this. The data which I am storing is too big to be stored in the registry.


回答1:


There is two simple functions do read and write data from tmp:/ folder:

  • ReadAsciiFile(filepath as String) as String

    text=ReadAsciiFile("tmp:/config.txt")

  • WriteAsciiFile(filepath as String, text as String) as Boolean

    WriteAsciiFile("tmp:/config.txt", "the text to write")

Further documentation in source.

Source: http://sdkdocs.roku.com/display/sdkdoc/BrightScript+Language+Reference#BrightScriptLanguageReference-78ReadAsciiFilefilepathasStringasString



来源:https://stackoverflow.com/questions/31723083/read-and-write-from-temp-file-in-roku

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!