What to do with the .prg_Snapshots folders and .evsettings files?

For requesting general information about EViews, sharing your own tips and tricks, and information on EViews training or guides.

Moderators: EViews Gareth, EViews Moderator

Phil09
Posts: 15
Joined: Fri Mar 17, 2017 11:10 am

What to do with the .prg_Snapshots folders and .evsettings files?

Postby Phil09 » Mon Jun 17, 2024 12:36 pm

Multiple .prg_Snapshots folders and .evsettings files appeared in my Eviews work folders that I did not notice before. Had they been there all along but were hidden from view? If so, how can I hide them again? What are the uses of these folders/files?

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13610
Joined: Tue Sep 16, 2008 5:38 pm

Re: What to do with the .prg_Snapshots folders and .evsettings files?

Postby EViews Gareth » Mon Jun 17, 2024 2:53 pm

You can tell Windows to not show hidden folders/files, then you won't see them.

Snapshot folders contain the automatic (or manual) backups/snapshots of the workfile or program.

.evsettings on programs contains the debugging information when debugging a program.

Phil09
Posts: 15
Joined: Fri Mar 17, 2017 11:10 am

Re: What to do with the .prg_Snapshots folders and .evsettings files?

Postby Phil09 » Tue Jul 30, 2024 10:24 am

Company IT policy would not allow me to change hidden file settings. Is there a way to ask EViews software to not generate these files?

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13610
Joined: Tue Sep 16, 2008 5:38 pm

Re: What to do with the .prg_Snapshots folders and .evsettings files?

Postby EViews Gareth » Tue Jul 30, 2024 10:26 am

Options->General Options->Snapshots

uyanikcaner
Posts: 24
Joined: Sat Dec 05, 2020 8:31 am

Re: What to do with the .prg_Snapshots folders and .evsettings files?

Postby uyanikcaner » Fri Jul 17, 2026 5:09 am

Is there any way to open the last saved snapshot of a workfile using an Eviews code? Do we have to click view->snapshots->open or ->revert to every time? Do you have any future plans for this?

EViews Steve
EViews Developer
Posts: 846
Joined: Tue Sep 16, 2008 3:00 pm
Location: Irvine, CA

Re: What to do with the .prg_Snapshots folders and .evsettings files?

Postby EViews Steve » Sat Jul 25, 2026 6:33 pm

While there isn't an EViews command to automatically open a snapshot, you can do it programmatically.

First, EViews snapshots are usually saved in the same folder as the base workfile/program. The folder is hidden and the folder name just starts with the name of the base file followed by "_Snapshots". For example, if you have a workfile named "simple.wf1", the snapshot folder name would be "simple.wf1_Snapshots".

Next, the snapshots in that folder are just copies of the original workfile/program. The only difference is that each snapshot is prefixed with "snapshot_" (instead of the original base name) followed by the current date and time (local). There's also a matching JSON text file for each snapshot that contains some metadata. For our "simple.wf1" example, you might see:
  • snapshot_20260725_180156.json
  • snapshot_20260725_180156.wf1
Because snapshot_20260725_180156.wf1 file is just a regular workfile, you can open this using our WFOPEN command. You just have to figure out the path.

Here's an example EViews Program that does this for a given folder and workfile name:

Code: Select all

'================================================================== ' Find the most recent .wf1 file in "<StaticName>_Snapshots" '================================================================== '--- 1. Inputs: set these as needed ------------------------------- %basepath = "C:\files\" ' folder that CONTAINS the snapshots folder %staticname = "simple.wf1" ' your static file name (no extension needed) '--- 2. Build the snapshots subdirectory path --------------------- %subdir = %staticname + "_Snapshots" %snapdir = %basepath + %subdir '--- 3. Make sure the folder actually exists ----------------------- if @folderexist(%snapdir) = 0 then statusline Folder not found: {%snapdir} stop endif '--- 4. Get the list of ALL files in that folder -------------------- %filelist = @wdir(%snapdir, "f") !nfiles = @wcount(%filelist) if !nfiles = 0 then statusline No files found in {%snapdir} stop endif '--- 5. Walk the list, keeping only .wf1 files, track the "largest" name %latest = "" !found = 0 for !i = 1 to !nfiles %candidate = @word(%filelist, !i) %ext = @lower(@right(%candidate, 4)) ' last 4 chars, e.g. ".wf1" if %ext = ".wf1" then !found = 1 if %latest = "" then %latest = %candidate else if %candidate > %latest then %latest = %candidate endif endif endif next if !found = 0 then statusline No .wf1 files found in {%snapdir} stop endif '--- 6. Report / use the result ------------------------------------- %latestpath = %snapdir + "\" + %latest 'statusline Most recent .wf1 snapshot: {%latest} 'statusline Full path: {%latestpath} ' Example of using it: wfopen {%latestpath}
Steve

uyanikcaner
Posts: 24
Joined: Sat Dec 05, 2020 8:31 am

Re: What to do with the .prg_Snapshots folders and .evsettings files?

Postby uyanikcaner » Thu Jul 30, 2026 1:31 am

While there isn't an EViews command to automatically open a snapshot, you can do it programmatically.

First, EViews snapshots are usually saved in the same folder as the base workfile/program. The folder is hidden and the folder name just starts with the name of the base file followed by "_Snapshots". For example, if you have a workfile named "simple.wf1", the snapshot folder name would be "simple.wf1_Snapshots".

Next, the snapshots in that folder are just copies of the original workfile/program. The only difference is that each snapshot is prefixed with "snapshot_" (instead of the original base name) followed by the current date and time (local). There's also a matching JSON text file for each snapshot that contains some metadata. For our "simple.wf1" example, you might see:
  • snapshot_20260725_180156.json
  • snapshot_20260725_180156.wf1
Because snapshot_20260725_180156.wf1 file is just a regular workfile, you can open this using our WFOPEN command. You just have to figure out the path.

Here's an example EViews Program that does this for a given folder and workfile name:

Code: Select all

'================================================================== ' Find the most recent .wf1 file in "<StaticName>_Snapshots" '================================================================== '--- 1. Inputs: set these as needed ------------------------------- %basepath = "C:\files\" ' folder that CONTAINS the snapshots folder %staticname = "simple.wf1" ' your static file name (no extension needed) '--- 2. Build the snapshots subdirectory path --------------------- %subdir = %staticname + "_Snapshots" %snapdir = %basepath + %subdir '--- 3. Make sure the folder actually exists ----------------------- if @folderexist(%snapdir) = 0 then statusline Folder not found: {%snapdir} stop endif '--- 4. Get the list of ALL files in that folder -------------------- %filelist = @wdir(%snapdir, "f") !nfiles = @wcount(%filelist) if !nfiles = 0 then statusline No files found in {%snapdir} stop endif '--- 5. Walk the list, keeping only .wf1 files, track the "largest" name %latest = "" !found = 0 for !i = 1 to !nfiles %candidate = @word(%filelist, !i) %ext = @lower(@right(%candidate, 4)) ' last 4 chars, e.g. ".wf1" if %ext = ".wf1" then !found = 1 if %latest = "" then %latest = %candidate else if %candidate > %latest then %latest = %candidate endif endif endif next if !found = 0 then statusline No .wf1 files found in {%snapdir} stop endif '--- 6. Report / use the result ------------------------------------- %latestpath = %snapdir + "\" + %latest 'statusline Most recent .wf1 snapshot: {%latest} 'statusline Full path: {%latestpath} ' Example of using it: wfopen {%latestpath}
Steve
Thank you Steve. It worked!


Return to “General Information and Tips and Tricks”

Who is online

Users browsing this forum: No registered users and 2 guests