What to do with the .prg_Snapshots folders and .evsettings files?
Moderators: EViews Gareth, EViews Moderator
What to do with the .prg_Snapshots folders and .evsettings files?
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?
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.
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.
Re: What to do with the .prg_Snapshots folders and .evsettings files?
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?
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?
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?
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:
Here's an example EViews Program that does this for a given folder and workfile name:
Steve
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
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}
-
uyanikcaner
- Posts: 24
- Joined: Sat Dec 05, 2020 8:31 am
Re: What to do with the .prg_Snapshots folders and .evsettings files?
Thank you Steve. It worked!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:
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.
- snapshot_20260725_180156.json
- snapshot_20260725_180156.wf1
Here's an example EViews Program that does this for a given folder and workfile name:
SteveCode: 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}
Return to “General Information and Tips and Tricks”
Who is online
Users browsing this forum: No registered users and 2 guests
