> Hi,
>
[quoted text clipped - 16 lines]
> Ciao,
> Ingo
Windows 95
:: makes a face ::
Anyway, that's one question I've always had - shouldn't Java work the
same way across all OSes? Or does the way Java reacts depend on the
underlying OS (such as renaming a file via Windows vs. Linux).
Chris Smith - 06 Mar 2007 14:45 GMT
> Anyway, that's one question I've always had - shouldn't Java work the
> same way across all OSes? Or does the way Java reacts depend on the
> underlying OS (such as renaming a file via Windows vs. Linux).
Java has to balance portability (working the same across all operating
systems) with usability (working the way users of the operating system
would expect). Perhaps it would be possible for Java to invent a scheme
to prevent itself from deleting an open file on Linux; but Linux users,
who are by and large knowledgable about how UNIX typically manages a
filesystem, would not expect it to do so. Using File in creative ways
is not transparently portable anyway (e.g., permissions issues), it
makes sense that Java would choose the other goal here.

Signature
Chris Smith
Ingo R. Homann - 06 Mar 2007 15:07 GMT
Hi Jason,
> Anyway, that's one question I've always had - shouldn't Java work the
> same way across all OSes? Or does the way Java reacts depend on the
> underlying OS (such as renaming a file via Windows vs. Linux).
Well, as Chris said: It has to be well-balanced.
To be extreme: Would you want to forbid 'System.getProperty("os.name")'
because it reacts differently on different OSs? Do you want to generally
forbid File-IO, because there are some embedded systems that do not have
something like a Harddisk (not to mention applets or webstart)? Should
the maximum size of a window that Java can use, be restricted to 80*40
pixel because that is the only resolution, that *every* hardware (even
mobile phones) supports? Should we forbid network-support?
The other extreme: Should sun invest some months of manpower (not to
mention legal problems) to 'hack' Windows so that Java can rename a file
that is opened by another program? Or should it hack Unix and Linux so
that the File can *not* be renamed, although it would be supported by
the OS?
I think the balance between the two extremes should be practical. And
that is what's happening at the moment. :-)
Ciao,
Ingo