PersistenceLocation

PersistenceLocation["type"]

represents a persistence location of the given type.

PersistenceLocation["type",base]

includes the base address for a location type that allows multiple locations.

Details and Options

  • Supported location types include:
  • "KernelSession"current invocation of the Wolfram Language kernel
    "FrontEndSession"current invocation of the Wolfram Notebook front end
    "Local"local to a computer, based on user home directory
    "LocalShared"local to a computer, based on $BaseDirectory
    "Cloud"in the cloud defined by the current $CloudBase
    "Installation"installation defaults
  • In expressions such as PersistentValue["name","type"], the string "type" is treated as a short form for PersistenceLocation["type"].
  • The default base for the "Local" persistence location type is LocalObject["Persistence",$DefaultLocalBase].
  • The default base for the "LocalShared" persistence location type is LocalObject["Persistence",$BaseDirectory].
  • The default base for the "Cloud" persistence location type is CloudObject["Persistence"].

Examples

open allclose all

Basic Examples  (3)

The "Local" persistence location stores values as local objects under $LocalBase:

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

The "FrontEndSession" persistence location stores values in the running Wolfram Notebook front end:

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

The "Cloud" persistence location stores values as cloud objects:

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

Scope  (6)

Generalizations & Extensions  (2)

Properties & Relations  (3)

Possible Issues  (3)

See Also

PersistentValue  PersistentObject  $PersistencePath  $PersistenceBase  $BaseDirectory  $DefaultLocalBase  $CloudBase  $EvaluationEnvironment

Introduced in 2017
(11.1)