PersistentObject

PersistentObject["name",loc]

represents a persistent object stored at persistence location loc.

Details

  • PersistentObject["name",loc]["meta"]=val sets the metadata element "meta" to val.
  • The following metadata elements can be given:
  • "Value"Nullthe value of the persistent object itself
    "HeldValue"Hold[Null]the value wrapped in Hold
    "MergingFunction"Automaticthe default merging function to use
    "ModificationDate"Nonetime stamp of last modification
    "ExpirationDate"Nonetime after which data is no longer used
    "Creator"$UserNameuser who last modified the object
  • PersistentObject["name",loc][All] gives the association of all metadata.
  • DeleteFile[PersistentObject[]] removes a persistent object from the specified location.
  • A persistence location is given as PersistenceLocation["type"] or "type".

Examples

open allclose all

Basic Examples  (1)

Create a persistent object by assigning it a value:

In[1]:=
Click for copyable input
In[2]:=
Click for copyable input
Out[2]=

Give all metadata of the object:

In[3]:=
Click for copyable input
Out[3]=

Give a specific meta element:

In[4]:=
Click for copyable input
Out[4]=

Scope  (1)

Properties & Relations  (3)

Possible Issues  (1)

See Also

PersistentValue  PersistenceLocation  PersistentObjects  LocalObject  CloudObject  ResourceObject  Databin

Introduced in 2017
(11.1)