Skip to end of metadata
Go to start of metadata

digium.writeFile

Writes the string into a file. The filename is relative to the location that is specified (this is a flat directory).

Basic Example: 

 

If the file exists, it is overwritten with the string. If the file does not exist, it is created.

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.

string
Yes
string
 

String to act on.

 

Examples

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

  • No labels