harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mikhail Markov (JIRA)" <j...@apache.org>
Subject [jira] Updated: (HARMONY-4012) [classlib][luni] OSFileSystem.open can't open system special files(nul)
Date Mon, 04 Jun 2007 18:06:26 GMT

     [ https://issues.apache.org/jira/browse/HARMONY-4012?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Mikhail Markov updated HARMONY-4012:
------------------------------------

    Attachment: H-4012.patch

Here is the patch fixing the issue + regression test.

Fix description: when trying to open "nul" file for writing via FileOutputStream, HyOpenTruncate
mode is specified, so the file was first opened, then closed and then reopened with TRUNCATE_EXISTING
option leading to the error. I've added the check if the file is ordinary disk file before
trying to truncate it.
(Also i've fixed to regression test for FileOutputStream(String) constructor as it was a minor
problem there.)

> [classlib][luni] OSFileSystem.open can't open system special files(nul)
> -----------------------------------------------------------------------
>
>                 Key: HARMONY-4012
>                 URL: https://issues.apache.org/jira/browse/HARMONY-4012
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>         Environment: Windows
>            Reporter: Dennis Ushakov
>         Attachments: H-4012.patch
>
>
> OSFileSystem.open can't open system special files like 'nul'
> Test:
> import java.io.FileOutputStream;
> public class NulWrite {
> 	public static void main(String[] args) throws Exception {
> 		new FileOutputStream("nul");
> 		System.err.println("OK");
> 	}
> }
> Output on Harmony - r542118
> Uncaught exception in main:
> java.io.FileNotFoundException: C:\home\workspace\Trash\nul
> 	at org.apache.harmony.luni.platform.OSFileSystem.open(OSFileSystem.java:227)
> 	at java.io.FileOutputStream.<init>(FileOutputStream.java:98)
> 	at java.io.FileOutputStream.<init>(FileOutputStream.java:163)
> 	at java.io.FileOutputStream.<init>(FileOutputStream.java:142)
> 	at NulWrite.main(NulWrite.java:6)
> Output on RI
> OK

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message