The IDL_Savefile object provides complete query and restore capabilities for IDL SAVE files. IDL SAVE files are binary format files created with the SAVE procedure; they can contain data or IDL routines. Using IDL_Savefile, you can retrieve information about the user, machine, and system that created the SAVE file, as well as the number and size of the various items contained in the file (variables, common blocks, routines, etc.). You can also selectively restore individual items from the SAVE file.
Use IDL_Savefile instead of the RESTORE procedure when you need to obtain detailed information on the items contained within a SAVE file without first restoring it, or when you wish to restore only selected items. Use RESTORE when you want to restore everything from the SAVE file using a simple interface.
Objects of this class have no properties of their own.
This class has the following methods:
In addition, this class inherits the methods of its superclasses (if any).
Use the IDL_Savefile object to query the contents of a SAVE file containing data and selectively restore variables.
Typically, IDL_Savefile::Contents is the first method called on a savefile object; the information retrieved indicates the number of different types of items contained in the file (variables, routines, etc.). Next, a call to IDL_Savefile::Names is used to obtain the names of items of a specific type. IDL_Savefile::Size can be used to determine the size of variables in the file, and IDL_Savefile::Restore can be used to restore items for use within the current IDL session.
savefile = FILEPATH('cduskcD1400.sav', $
sObj = OBJ_NEW('IDL_Savefile', savefile)
sContents = sObj->Contents()
sNames = sObj->Names()
sDensitySize = sObj->Size('density')
HEAP_NOSAVE, HEAP_SAVE, RESTORE, SAVE