If you just want to prevent casual/accidental, rather than
determined modification, after you close the file:


File.chmod("/options.sav", 0440);

For example.

RF

Pat Kiatchaipipat wrote:
> hi, I have problem about writing file.
> I use this
> 
> data = File.new("/options.sav","w")
> 
> and I get file name option.sav in my path but when I open it with
> notepad. It can modify :'( I don't want this because options.sav has
> save data from my app that can't hack it! how can I write file with
> can't be modified???