Closed simoc closed 8 years ago
Thanks for reporting this issue. Note that this library is no longer in active development, however we are accepting pull requests (if we agree with them, of course).
The issue results from the fact that we always open the file with "rw", here. That parameter could be made configurable, of course. If you do that, make sure that all the methods in the library that try to write to the dbf throw a clear exception, that makes it clear to the caller what is going wrong.
That said, an obvious work-around for you would be to first make a copy of sample.dbf
that is also writable and then read from that copy. That is assuming that you cannot make the original sample.dbf
writable for some reason.
I will create a pull request with my changes to enable read-only DBF files to be used.
Thanks for contributing your patch :+1:
If my DBF file has write permission then it is opened successfully. However, if my DBF file is read-only, then the method Table.open() throws an java.io.FileNotFoundException. For example,
the following Java code:
results in: