Page 1 of 1
Open read-only?
Posted: Fri May 18, 2012 3:54 am
by paues
Is it possible to open databases and workfiles read-only? If not, is this something you might consider including?
Re: Open read-only?
Posted: Fri May 18, 2012 8:29 am
by EViews Chris
I'm not sure exactly what you have in mind here.
EViews uses read-only file handles whenever it reads from a database or workfile, and read-write file handles when it writes to a database/workfile.
This means that you are able to set read only permissions on files at the operating system level (including by user, where available) and that would stop either all users or a selected group of users writing to the file.
You can also toggle these file permissions from within an EViews program using a DOS command:
shell attrib +r myfile.wf1
makes the file read only.
shell attrib -r myfile.wf1
makes it writeable again.
Is there something else you have in mind?
Re: Open read-only?
Posted: Fri May 18, 2012 8:33 am
by EViews Chris
I should add that for and EViews database, setting the permissions on the file with the .edb extension should be sufficient.
Re: Open read-only?
Posted: Mon May 21, 2012 4:22 am
by paues
I see now that it works just fine setting the file permissions to read-only with databases. However, with workfiles this does not help me. I would like to not be able to alter a workfile when it is read-only. And have some syntax enabling me to open a file as read-only, even if the file permissions are not set to read-only.
The code below disregards that the workfile is read-only. Thus the second series (tmp2) is created in the final row, eventhough that row should return an error.
Code: Select all
wfcreate a 1980 2012
series tmp=0
wfsave c:\temp\test.wf1
close @all
shell attrib +r c:\temp\test.wf1
wfopen c:\temp\test.wf1
series tmp2=0
Open read-only?
Posted: Mon May 21, 2012 6:55 am
by EViews Gareth
You will be unable to save the workfile though, so the version on disk will remain unchanged.