Carey Brown wrote:
I don't see anything obviously wrong with your code. I'd need to know more about your table model. You seem to have more columns in your model than you want to write. Can you just write out the specific columns that you're interested in? You may have an issue with your newlines: \n vs \r\n, depending on which program you use to view the file.
Carey Brown wrote:Call setReadOnly() after you write and close the file.
Knute Snortum wrote:Can you post the code that is trying to set the file to read only?
Stephan van Hulst wrote:What operating system are you working with?
Stephan van Hulst wrote:Hi Vlad, welcome to CodeRanch!
You should probably take a look at Files.setAttribute() to set an operating system specific attribute (such as "acl:acl", "posix:permissions" or "dos:readonly").
If that fails, take a look at File.setReadOnly().