hi all, I have a directory name /abc/Foo/allFilesHere that created by user "A" and Foo directory mode is 777 and allFilesHere is 444. By using Unix scripting allows me to delete or modify all the files under "Foo" directory. [except no allow to change mode chmod] Now the problem i'm facing is by using Java, File.canWrite() [under the "Foo" directory] it return me false. How should i able to delete the file using java while File.canWrite() return me false? Thanks in advance. Regards, sato
If you can't change the direction the the wind, change your sail.
If I remember right, having a directory with 777 permissions that contains a file with 444 permissions sets up a somewhat paradoxical situation in Unix. You can't directly modify the file, because it is read only, but you can delete it and create another with the same name. That's because those are directory operations and you have full permissions on the directory. Your Java application is obliged to follow the same rules that the command-line shell does.
You ought to ventilate your mind and let the cobwebs out of it. Use this cup to catch the tiny ads: