Achim Holtmann New Member
Posts:4  
17 Apr 2019 08:05 AM |
|
A sav file cannot be restored by IDL v8.7.2 when it contains a list and was written in IDL v8.6.1 and vice versa. Example: a = list([1,2,3]) save, a, FILENAME='test.sav' In the documentation (https://www.harrisgeospatial.com/docs/Creating_SAVE_Files_of_P.html) it says that sav files are backward compatible which does not seem to be the case. The error I get when opening the file in the other IDL version is the following: % Wrong number of tags defined for structure: LIST. % RESTORE: Structure not restored due to conflict with existing definition: LIST.
|
|
|
|
Ben Castellani Basic Member
Posts:130  
26 Apr 2019 09:56 AM |
|
Between IDL 8.6.1 and 8.7.0, some changes were made to the LIST class to improve performance. SAV files remain backwards compatible, however. The problem here is that your SAV file is explicitly including "list__define.sav" which is part of every IDL installation. This is not good practice. To resolve this issue, you can do one of the following: 1) Rebuild your SAV file making sure that list__define.sav is not included. 2) Before restoring your existing SAV file in IDL 8.7.2, load in the correct LIST class definition and then use SKIP_EXISTING when restoring it. Like this: ;Create a list to load the (correct) class definition void = list() ;Restore your SAV file, skipping all that is loaded already RESTORE, "foo.sav",/SKIP
|
|
|
|
Achim Holtmann New Member
Posts:4  
02 May 2019 02:48 AM |
|
Thanks for the response! I am not sure how to follow the first suggestion. How do I save a list following "good practice"? The save procedure seemed pretty straight-forward to me. Could you provide example code? Unfortunately, the second suggestion does not work for me - I get the same error as before. Cheers
|
|
|
|
Ben Castellani Basic Member
Posts:130  
08 May 2019 11:46 AM |
|
Happy to help. The second suggestion should definitely work. What does this this command return from your IDL console session? file_which('list__define.sav')
|
|
|
|
Achim Holtmann New Member
Posts:4  
03 Jun 2019 06:13 AM |
|
Hello again, in IDL 8.7.2 the statement file_which('list__define.sav') returns: C:\Program Files\Harris\IDL87\lib\datatypes\list__define.sav in IDL 8.6.1 the statement file_which('list__define.sav') returns: C:\Program Files\Harris\IDL86\lib\datatypes\list__define.sav Thanks again.
|
|
|
|