On 2/9/07, LvJimmy,Jing <[EMAIL PROTECTED]> wrote:
2007/2/9, Andrew Zhang <[EMAIL PROTECTED]>: > Hi, Sorry for my late reply. Unfortunately, my disk got broken so that my > working on Harmony is stopped. I hope I'll resume developing soon. > ;) > Ruth, Thanks for your patch! There're two ways to solve this problem: > 1. Using a boolean to mark whether this fd is readonly. That's also what you > did. > 2. Judging the fd by native code. It requires to modify native code. > I think solution one is much easier, it do make sense as only FileInputStream create a read-only fd.
how about opening RandomAccessFile with "r" option? :) It may be much harder to detect
native fd. > I'm fine with either approach. That's also to say, your patch looks fine to > me. :-) Thanks! > > > On 2/8/07, Ruth Cao (JIRA) <[EMAIL PROTECTED]> wrote: > > > > > > [ > > https://issues.apache.org/jira/browse/HARMONY-1494?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12471252 ] > > > > Ruth Cao commented on HARMONY-1494: > > ----------------------------------- > > > > Hi all, > > > > I've found that this issue is related to sync() using a read-only handle. > > I'll provide a patch soon. Thanks. > > > > Ruth > > > > > [classlib][luni] FileDescriptor.sync() throws unexpected > > SyncFailedException when the descriptor is read-only. > > > > > -------------------------------------------------------------------------------------------------------------- > > > > > > Key: HARMONY-1494 > > > URL: https://issues.apache.org/jira/browse/HARMONY-1494 > > > Project: Harmony > > > Issue Type: Bug > > > Components: Classlib > > > Reporter: Andrew Zhang > > > > > > Following test case reproduces the bug: > > > public void testSyncReadOnly() throws Exception { > > > String TESTFILE = "tempFile"; > > > try { > > > FileOutputStream fos = new FileOutputStream(TESTFILE); > > > fos.write("something".getBytes()); > > > fos.close(); > > > RandomAccessFile raf = new RandomAccessFile(TESTFILE, "rw"); > > > raf.getFD().sync(); > > > raf.close(); > > > FileInputStream fis = new FileInputStream(TESTFILE); > > > fis.getFD().sync(); > > > fis.close(); > > > } finally { > > > new File(TESTFILE).delete(); > > > } > > > } > > > The test passes against RI while fails against Harmony. I'll try to fix > > this problem. > > > Best regards, > > > Andrew > > > > -- > > This message is automatically generated by JIRA. > > - > > You can reply to this email to add a comment to the issue online. > > > > > > > -- > Best regards, > Andrew Zhang > -- Best Regards! Jimmy, Jing Lv China Software Development Lab, IBM
-- Best regards, Andrew Zhang
