Arne said:
If you use JNI and define a C API with certain semantics, then
it should be a relative simple task to implement that on a new
platform (assuming that there are expertise about the platform
available).
In the present case JNI would be more expensive.
I would need to create and bundle a .dll, a
..so and a .dyln. And need 3 different platforms
to develop them. (When I want to support Windows,
Linux and Mac)
Using sun.misc.* takes about 1 hour to implement
the Ctrl-C handler. If someone comes up with
a platform where there is no sun.misc.*, it might
be that there is already some other Java class.
"personally" using JNI to make something CPU/OS independent
is most of the time last resort and NOT a good advice.
There are bigger entities which have most likely already
faced the problem. One has only to search.
For example I found the following just now:
http://rxr.whitequark.org/jruby/source/src/org/jruby/util/SunSignalFacade.java
org.jruby.util.SunSignalFacade
But did not dig further. But for example the
good news are the IBM J9 has also sun.misc.*.
BTW: It was you guys who slapped this into my
face a dozen times, that I have a "personal" program-
ming problem, i.e. that it is my fault. But "personal"
programming problems that are CPU/OS independent
should never call for JNI. Just look around whether
the problem is not so "personal".
But currently I don't waste some time on sun.misc.*,
what interests me is:
FileInputStreamFix
Which fixes the superflous <EOF>. This is also the
title of the thread, and not where do I find a portable
sun.misc.*.
But the same principle does not apply,
that JNI is last resort. Since it is Windows specific,
thats why I put [Windows] in the thread title. Here
you are right a JNI solutions is feasible.
So please forget about sun.misc.* and focus on
the <EOF> issue.
Bye