Skip to end of metadata
Go to start of metadata


Application storage

Several means are available for an application to store data:

StorageAdvantagesDisadvantages
file in tmp:Files are read/writeContents are not retained when application exits
file in pkg:Accesses any files included in app packageFiles are read only
file on USB deviceAccesses files on removable USB mediaFiles are read only; not all Roku models support USB
RegistryData is read/write; data is retained when
the application exits and when the system reboots.
Data size is limited. Each channel has access to only 16kb of registry space.

Depending on your application's requirements, you can choose one of these options.  Interfaces to the registry are documented at roRegistry.  Interfaces to files are described below.

Pathnames

A Roku Streaming Player Pathname identifies a file.  Pathnames are used in ifFileSystem methods, as well as in other components which use files.  A Pathname is a string with the following format: 

device:/dir1/dir2/…/filename

The device field (sometimes called PHY) identifies the location of the file, and can be one of:

  • tmp - temporary file storage device for the application
  • pkg - root of the application directory that provides read-only access to files provided in the pkg

Since Firmware version 2.6:

  • common – a common read-only filesystem that all plugins have access to. Currently it only contains a CA certificate bundle that contains CA certs trusted by FireFox (common:/certs/ca-bundle.crt). You are encouraged to use this file in your apps, especially if you are aggregating many different feeds. Please see the twitterOAuth sample application for a usage example.
  • ext1, ext2, …,ext9 – storage devices recognized on the USB bus. Please see the usbplayer sample application for a usage example.

There is no concept of a current working directory or relative paths. All path names must use the absolute Roku Streaming Player Pathname format above.

The filename components in a pathname may not contain any of these characters:

  <  >  :  "  /  |  ?  *

nor any whitespace or non-printable character.

Examples

Example of path names used from BrightScript
  • No labels