Return-Path: Delivered-To: apmail-harmony-commits-archive@www.apache.org Received: (qmail 70124 invoked from network); 4 Jan 2008 11:35:56 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 4 Jan 2008 11:35:56 -0000 Received: (qmail 85667 invoked by uid 500); 4 Jan 2008 11:35:45 -0000 Delivered-To: apmail-harmony-commits-archive@harmony.apache.org Received: (qmail 85641 invoked by uid 500); 4 Jan 2008 11:35:45 -0000 Mailing-List: contact commits-help@harmony.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@harmony.apache.org Delivered-To: mailing list commits@harmony.apache.org Received: (qmail 85631 invoked by uid 99); 4 Jan 2008 11:35:45 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 04 Jan 2008 03:35:45 -0800 X-ASF-Spam-Status: No, hits=-100.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO brutus.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 04 Jan 2008 11:35:42 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 1BD5E714187 for ; Fri, 4 Jan 2008 03:35:34 -0800 (PST) Message-ID: <21806807.1199446534111.JavaMail.jira@brutus> Date: Fri, 4 Jan 2008 03:35:34 -0800 (PST) From: "Tim Ellison (JIRA)" To: commits@harmony.apache.org Subject: [jira] Closed: (HARMONY-508) [classlib][luni] java.io.FileOutputStream.getChannel().position() returns incorrect value on Linux platform MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/HARMONY-508?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Tim Ellison closed HARMONY-508. ------------------------------- Finally closing this issue. I fixed Paulex's concerns in the testcase in repo revision r608805. > [classlib][luni] java.io.FileOutputStream.getChannel().position() returns incorrect value on Linux platform > ----------------------------------------------------------------------------------------------------------- > > Key: HARMONY-508 > URL: https://issues.apache.org/jira/browse/HARMONY-508 > Project: Harmony > Issue Type: Bug > Components: Classlib > Reporter: Nikolay Bannikov > Assignee: Tim Ellison > Priority: Minor > Attachments: FileOutputStreamTest.diffs, harmony-508.diff > > > According to J2SE 1.5 specifications: > The initial position of the returned channel will be equal to the number of bytes written to the file so far unless this stream is in append mode, in which case it will be equal to the size of the file. > import java.io.*; > public class Test{ > public static void main(String[] args) { > FileOutputStream f = null; > try { > File tmpfile = File.createTempFile("FileOutputStream", "tmp"); > tmpfile.deleteOnExit(); > FileOutputStream fos = new FileOutputStream(tmpfile); > byte[] b = new byte[10]; > for (int i = 10; i < b.length; i++) { > b[i] = (byte) i; > } > fos.write(b); > fos.flush(); > fos.close(); > f = new FileOutputStream(tmpfile, true); > System.out.println("position = "+f.getChannel().position()); > } catch (FileNotFoundException fnfe) { > } catch (IOException ioe) { > } catch (SecurityException se) { > } > } > } > Output on Harmony (Windows): > position = 10 > Output on Harmony (Linux): > position = 0 -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.