• Post Reply Bookmark Topic Watch Topic
  • New Topic

create unwritable file  RSS feed

 
michael yue
Ranch Hand
Posts: 204
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

I just want to ask whether it is possible to make a file unwritable after the file has been written into. For example, i write some text into a txt file then i make the file lock being it can be read only and cannot be written into.

Thanks a lot
 
Neeraj Dheer
Ranch Hand
Posts: 225
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!

after the file has been written into, use the File class tomake it 'unwritable' or in other words, 'read only'.



that sets the read only attribute of the file to true, hence making the file read-only.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!