Skip to end of metadata
Go to start of metadata

digium.readFile

Description

 

Reads the contents of a file as utf-8 and returns the contents as a string. The filename is relative to the location that is specified (this is a flat directory).


Basic Example: 

 

Parameters

 

NameRequiredTypeDefaultDescription
location
Yes
string
 

Read-only location parameters:

app The app's own directory (so you can read files included in the app's zip file).
data The /app/data directory.

Read and write location parameters:

nv Non-volatile storage.  Data stored here survives firmware updates.
tmp Temporary storage. Data stored here is lost on restart.
nvshared Shared non-volatile storage that all custom apps can access.
tmpshared Shared temporary storage that all custom apps can access.

filename
Yes
string
 

Name of the file to act on.

 

Examples

Using digium.readFile / digium.writeFile to store settings.

  • No labels