harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Paulex Yang (JIRA)" <j...@apache.org>
Subject [jira] Assigned: (HARMONY-1497) [classlib][luni] java.io.File.length could not reflect the latest file attribute
Date Wed, 20 Sep 2006 07:21:26 GMT
     [ http://issues.apache.org/jira/browse/HARMONY-1497?page=all ]

Paulex Yang reassigned HARMONY-1497:
------------------------------------

    Assignee: Paulex Yang

> [classlib][luni] java.io.File.length could not reflect the latest file attribute
> --------------------------------------------------------------------------------
>
>                 Key: HARMONY-1497
>                 URL: http://issues.apache.org/jira/browse/HARMONY-1497
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Richard Liang
>         Assigned To: Paulex Yang
>            Priority: Minor
>         Attachments: Harmony-1497.diff
>
>
> Hello,
> java.io.File.length has some delay when uses try to get the information about file length.
The following test case will demonstrate this issue.
> public void testFile() {
>        File derbyLog = new File("d:\\", "derby1.log");
>        try {
>            FileOutputStream fos = new FileOutputStream(derbyLog);
>            fos.write(0x41);
>            assertEquals(1, derbyLog.length());
>        } catch (Exception e) {
>            e.printStackTrace();
>        }
>    }
>    public void testFileChannel() {
>        File derbyLog = new File("d:\\", "derby2.log");
>        try {
>            FileOutputStream fos = new FileOutputStream(derbyLog);
>            FileChannel fc = fos.getChannel();
>            fc.write(ByteBuffer.wrap(new byte[]{0x41, 0x42}));
>            assertEquals(2, derbyLog.length());
>        } catch (Exception e) {
>            e.printStackTrace();
>        }
>    } 
> Best regards,
> Richard

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message