Java under Linux differs from Java under Windows 2003-09-09 - By Bill Gradwohl
Back I've been reading Beginning Java2 SDK 1.4 Edition by Ivor Horton.
As I work through the examples, some don't work as the book text would lead you to believe. If I compile the .java file on RH7.2 SMP and then execute the .class file on the same box and a W2K box, I get different outputs for certain file manipulations. The JVM is supposed to make the O/S a non issue, but clearly it is an issue. I'm wondering if what I'm seeing is some deficiency in my set up, if they are bugs in the JVM, if its an SMP issue, or some file handling issue in Linux in general.
Both of my Java environments are straight from Sun's web site. The author apparently used a Windows box to craft the examples because they work on my W2K box as he describes them in the text.
For Example, the renameTo method on Linux SMP deletes any target file that may already exist, and then renames the source to that target. Under Windows, the renameTo fails because the target file already exists.
Another example involves random writes to an existing file. Under Linux, all the writes get appended to the tail end of the file. Under Windows, the writes are truly random, appearing all over the file.
I know this isn't a JAVA list, but can anyone shed some light on this from the Linux perspective. It's only the file manipulations that are inconsistent.
Bill Gradwohl (817) 224-9400 x211 www.ycc.com SPAMstomper Protected Email
|
|