Return-Path: Delivered-To: apmail-incubator-harmony-dev-archive@www.apache.org Received: (qmail 2244 invoked from network); 26 Oct 2006 00:26:43 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 26 Oct 2006 00:26:41 -0000 Received: (qmail 47020 invoked by uid 500); 24 Oct 2006 16:08:48 -0000 Delivered-To: apmail-incubator-harmony-dev-archive@incubator.apache.org Received: (qmail 46989 invoked by uid 500); 24 Oct 2006 16:08:47 -0000 Mailing-List: contact harmony-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: harmony-dev@incubator.apache.org Delivered-To: mailing list harmony-dev@incubator.apache.org Received: (qmail 46980 invoked by uid 99); 24 Oct 2006 16:08:47 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 24 Oct 2006 09:08:47 -0700 X-ASF-Spam-Status: No, hits=0.5 required=10.0 tests=DNS_FROM_RFC_ABUSE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: domain of paulex.yang@gmail.com designates 66.249.92.174 as permitted sender) Received: from [66.249.92.174] (HELO ug-out-1314.google.com) (66.249.92.174) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 24 Oct 2006 09:08:34 -0700 Received: by ug-out-1314.google.com with SMTP id y2so1754247uge for ; Tue, 24 Oct 2006 09:08:10 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:user-agent:mime-version:to:subject:references:in-reply-to:content-type:content-transfer-encoding; b=NO0d8DO5xVncxcwpxmjuLRtJuJwwpQsdsUzOVqbpXR7+M+BPkAKzLuUsjR98+xQjZ7glz+rFeN4Lj8shVMt+fmDjBihNg9koSCjuN+kjtI5Oj1x47D2KgdjnTkobn5CqtWUDb3as0seUHUz9SIUkW2zuNdNHG+miQ5POgrrHu6I= Received: by 10.67.105.19 with SMTP id h19mr9111705ugm; Tue, 24 Oct 2006 09:08:09 -0700 (PDT) Received: from ?9.20.183.63? ( [195.212.29.67]) by mx.google.com with ESMTP id q40sm887628ugc.2006.10.24.09.08.09; Tue, 24 Oct 2006 09:08:09 -0700 (PDT) Message-ID: <453E3A6C.704@gmail.com> Date: Tue, 24 Oct 2006 17:08:12 +0100 From: Paulex Yang User-Agent: Thunderbird 1.5.0.7 (Windows/20060909) MIME-Version: 1.0 To: harmony-dev@incubator.apache.org Subject: Re: [classlib][luni] java.io.File bug? References: <453879F0.9010107@gmail.com> In-Reply-To: <453879F0.9010107@gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Spark Shen wrote: > Hi All: > > When login as 'root' under Linux, the following test case fails on > Harmony while passes on RI. > public void test_canWrite() throws IOException{ > File f = File.createTempFile("test", null); > f.setReadOnly(); > assertTrue(f.canWrite()); > f.deleteOnExit(); > } > I think RI's behavior is more reasonable since the 'root' account does > have read/write privilege for temp files. However, Harmony only treats > 'root' as ordinary other users. > It seems that similar problem happens on java.io.File.canRead(). I agree that RI's behavior is reasonable, although a little different with spec[1], Harmony should fix the implementation. [1]public boolean *setReadOnly* () Marks the file or directory named by this abstract pathname so that only read operations are allowed. After invoking this method the file or directory is guaranteed not to change until it is either deleted or marked to allow write access. Whether or not a read-only file or directory may be deleted depends upon the underlying system. > > As we all know, File class deals with many different file object on > many different file system, would any one test File behavior on other > file systems. I didn't follow, what you mean here? > > Best regards > -- Paulex Yang China Software Development Lab IBM