How to make a file read-only

Ads

This tutorial demonstrate how to create file and set its attribute read-only

Description:

This example demonstrate how to create a file and how to revoke the write
permission of the same file. The method createFile creates a file with a specified
name and setWritable(false) revoke the write persmission.. The method canWrite()
returns booleasn value which whether the file is write-able or not..