Hallo
I've found a bug, in _any_ java version.
Is in the method canWrite() of the class File.
I've created a CD with a working Linux (based on Suse 6.4).
In this CD there are the usual special devices under /dev.
I can read and write on these devies, with the correct privileges.
If I apply the method canWrite() on (for example) /dev/ttyS0
it returns false, but with the same user I can write and
read with that tty.
The effect was that comm library (rxtx) doesn't work, because
before register a device do a canWrite.
I've removed the test on canWrite and the library works, perfectly.
The same in this example, here I've a CD mounted with
dev,exec,suid options of course:
(new File("/cdrom/dev/ttyS0")).canWrite() -> reports false
but
(new FileOutputStream("/cdrom/dev/ttyS0").write("test".getBytes());
works, it writes the string on the serial and doesn't throw any axception!
A test on blackdown 1.1.8 and 1.2 final, Sun 1.2 and 1.3, IBM 1.3 give
the same result.
The manual of jdk in canWrite says
Returns:
true if the application is allowed to write to a file whose name is specified by
this object; false otherwise.
So apparently is a jdk problem
Bye
Fulco
----------------------------------------------------------------------
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]