-
Bug
-
Resolution: Fixed
-
P2
-
6
I have a read-only file and I am creating a FileOutputStream out of the read-only file. The FOS modifies the read-only file without any errors and make it '0' byte.
This is reproducible only on WinXP, only since Mustang-b63. Not reproducible on Mustang-b59c (throws an exception). Not reproducible on Solaris. The file that I have overwritten is not modifiable even by native applications and they say the file is read-only but Java is able to modify it.
I think this is a regression introduced by the following bug fixed in b63:
6350200: FileOutputStream.open() throws FileNotFoundException for hidden file (win)
This is a serious regression in Mustang-RC and java is not supposed to modify read-only files. Needs to be fixed ASAP.
I have attached a sample test and a sample image. Save them in the same directory. Change the cup.png file to read-only (typically r--r--r--). Run the application and pass the file name as argument. You will see that the file is getting modified and becomes a '0' byte file after creation of FOS even though File.canWrite() returns false.
This is reproducible only on WinXP, only since Mustang-b63. Not reproducible on Mustang-b59c (throws an exception). Not reproducible on Solaris. The file that I have overwritten is not modifiable even by native applications and they say the file is read-only but Java is able to modify it.
I think this is a regression introduced by the following bug fixed in b63:
6350200: FileOutputStream.open() throws FileNotFoundException for hidden file (win)
This is a serious regression in Mustang-RC and java is not supposed to modify read-only files. Needs to be fixed ASAP.
I have attached a sample test and a sample image. Save them in the same directory. Change the cup.png file to read-only (typically r--r--r--). Run the application and pass the file name as argument. You will see that the file is getting modified and becomes a '0' byte file after creation of FOS even though File.canWrite() returns false.
- relates to
-
JDK-6350200 FileOutputStream.open() throws FileNotFoundException for hidden file (win)
-
- Resolved
-
-
JDK-6401006 FileOutputStream.open() throws FileNotFoundException for hidden file (win)
-
- Closed
-