-
Notifications
You must be signed in to change notification settings - Fork 138
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
Trying to open a nonexisting table doesn't generate an error #542
Comments
For me FORM does crash here, though it should certainly give a useful error message.
It's a segfault since "enter" tries to loop through the tables without checking if there are any. Note that the
|
Ok, may be my version is too old: FORM 4.1 (May 15 2023, v4.1-20131025-587-g8a37a42). But I agree that a useful error message would be nice.
Is this expected? According to the manual
This doesn't read like a new file will be created if it doesn't exist so far. |
The behaviour regarding the tablebases should not have changed here since 8a37a42 . Can you try running the debug binary on your script under |
Ok, now I see the problem. When I run this code for the first time, it will crash but at the same time create an empty blabla.tbl. Then, running it for the second time will not generate any crashes. Tbh, I find this behavior quite confusing, since in real life the table might be missing for a reason and substituting it with an empty one is definitely not what the user would like. |
It would be straightforward to have "open" give an error and terminate FORM, in case the file doesn't exist. This could break people's existing FORM scripts in principle, so let's see if anyone else has opinions on this change. It is also not so nice that "create" overwrites existing files with the same name. Here one could check for an existing file and terminate if one is found. |
Is there another way to check for the physical existence of the table before "opening" it?
|
I don't think so with the |
Thanks. I also thought about that, but of course a native FORM command would be nicer. |
So far, no one has tried to implement it: #240 |
Speaking of pipes, I noticed that trying to check for the existance of a table using
My expectation is that if It works if I use something like
but this really contradicts the main idea of using exit in the first place. |
A possible compromise would be to change the manual stating that |
You need to use a preprocessor terminate:
My preference would be to make |
Ok, that makes sense. Thanks.
That would be an ideal solution, but at the cost of breaking someone's scripts who was silently using this bug as a feature. |
There should also be #531 merged at some point, readonly mode should certainly fail if the file doesn't exist. |
Hi,
I'm not sure if it's an omission or was originally intended like that, but I noticed that trying to
open a tablebase that physically doesn't exist on disk doesn't generate any errors.
Only when trying to insert an element from a nonexisting table will this code crash as it should.
Cheers,
Vlad
The text was updated successfully, but these errors were encountered: