NKing253 NKing253 - 3 years ago 223
Java Question

Setting file permissions using java.io.File methods

I'm using

java.io.File
methods:
setReadable
,
setWritable
,
setExecutable
to set file permissions. However, in spite of using these methods the permissions are always set to the default settings. Why is that?

Answer Source

These methods are not always supported by the underlying filesystem. E.g. it's not possible to make a point unreadable in NTFS on Windows XP.

There's more information here: www.oracle.com, under "Setting File and Directory Permissions"

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download