SetDataFolder
SetDataFolder dataFolderSpec
The SetDataFolder operation sets the current data folder to the specified data folder.
Parameters
dataFolderSpec can be a simple name (MyDataFolder), a path (root:MyDataFolder) or a string expression containing a name or path. It can also be a data folder reference created by the DFREF keyword or returned by GetDataFolderDFR.
If dataFolderSpec is a path it can be a partial path relative to the current data folder (:MyDataFolder) or an absolute path starting from root (root:MyDataFolder).
Examples
SetDataFolder foo // Sets CDF to foo in the current data folder
SetDataFolder :bar:foo // Sets CDF to foo in bar in current data folder
SetDataFolder root:foo // Sets CDF to foo in the root data folder
DFREF savedDF= GetDataFolderDFR() // Save current data folder
NewDataFolder/O/S root:MyDataFolder // Set CDF to a new data folder
Variable/G newVariable=1 // Do work in the new data folder
SetDataFolder savedDF // Restore current data folder