It seems that when I try to read the Component Library local file system with pkg: or libpkg: using file system object I get nothing. I was reading that the older SDK had a way to set read permissions for the library components from the main app? Is this gone now? Thanks!
You need to use libpkg: and the global utility functions starting here: https://developer.roku.com/en-ca/docs/references/brightscript/language/global-utility-functions.md#l...
roFileSystem won’t work.
It seems global Utility CopyFile is not working when trying to copy files from pkg to tmp. Nothing happens. Is this on purpose?
Also I don't seem have to have a way to access Component Library file system from the main app?
Thanks
The component library and app are sandboxed from each other. This is why you can’t copy to tmp.
What is interesting is that Copying file from one location to another within pkg doesn't work. Does Roku document these permissions?
Thanks!
They do not. Their documentation around component libraries is very limited. If your goal is to have a file in the library and get it in your own pkg code you are going to need to create a component in the library that can read the contents and return them to your pkg. then your pkg can write them to disk.
Component libraries are not designed to be a download anything solution. They are intended for you to be able to download custom SceneGraph components. Thus the name.
They used to. It is like they went backwards. Here is the text from their blog post in 2015.
Roku provides a mechanism for managing permissions for registry keys. An application can specify that a given registry key should have read and/or write permissions granted to one or more other applications or components.
To manage registry permissions, an application should follow these steps:
Note that permissions are granted on a per-application basis. To grant a permission to a component library, you should grant the permission to the package ID of the library (which can be obtained using the pkgId field of the roAssociativeArray returned by the GetManifest() method of the component library).
The post is only talking about registry. It doesn’t talk about the file system at all. Also I’m not sure this is even an issue anymore at least with registry access.