Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tablebase readonly mode #531

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from
Draft

Conversation

Herren
Copy link

@Herren Herren commented May 29, 2024

As suggested by @jodavies during the currently ongoing FORM workshop, I added an option
to the tablebase open command, allowing to open tablebases in read-only mode.
This allows to load tablebases in shared environments where not all users of the tablebases
have write permissions. In case the addto command is called on a readonly tablebase file,
an error is thrown and FORM terminates.

The syntax is simply:
TableBase "tablename.tbl" open, readonly

Some documentation on this feature is also added to the relevant manual file.

@coveralls
Copy link

Coverage Status

coverage: 50.002% (+0.003%) from 49.999%
when pulling 7ed3e84 on Herren:tablebase_readonly
into 83e3d41 on vermaseren:master.

@jodavies jodavies marked this pull request as draft June 7, 2024 10:49
@jodavies jodavies added this to the v5 milestone Nov 6, 2024
@jodavies
Copy link
Collaborator

jodavies commented Nov 7, 2024

Currently, if you attempt to open a non-existing tablebase in readonly mode, there is no error and the file is created. I think this case should print an error and terminate FORM.

@Herren
Copy link
Author

Herren commented Nov 22, 2024

Please have a look at the change. It should work now.

@jodavies
Copy link
Collaborator

Thanks, this works. Could you finally add test cases in check/features.frm for the failure modes, trying to add to an opened readonly table, and trying to open a non-existing table in readonly mode?

You can run multiple form scripts in a single test case like this: jodavies@9a5e42d

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants