EVALUATION
The java.io.File class has a setReadOnly operation but no corresponding way to
make a file writable because it is not clear how to specify the latter
operation. In particular, on multi-user systems you have to answer the
question of "writable by whom?" Even to ask this question requires dealing
with user identities, which is not something that the Java platform is yet
capable of doing. That will likely change in a future feature release, at
which time we'll revisit this issue.
In the absence of a way to make an existing file writable, you can always delete
the read-only file and rewrite a new, writable version. This is what many
source-code-control systems do anyway.
-- mr@eng 1998/10/30
Adding following methods in Mustang
setWritable(boolean writable, boolean ownerOnly);
setReadable(boolean readable, boolean ownerOnly)
setExecutable(boolean executable, boolean ownerOnly);
setExecutable(boolean executable);
setReadable(boolean readable);
setWritable(boolean writable);
canExecute();
|