harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paulex Yang <paulex.y...@gmail.com>
Subject Re: [classlib][luni] java.io.File bug?
Date Tue, 24 Oct 2006 16:08:12 GMT
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

View raw message