is there such thing as a version of tripwire implemented in Java?
.
Also how could you, using java know the File system type of a certain
partition and such pieces of info, without resorting to native calls?
.
otf
Thomas Hawtin - 02 Dec 2005 18:23 GMT
> is there such thing as a version of tripwire implemented in Java?
That would be a peculiar thing to do.
> Also how could you, using java know the File system type of a certain
> partition and such pieces of info, without resorting to native calls?
Reading /proc, assuming procfs is present?
Tom Hawtin

Signature
Unemployed English Java programmer
http://jroller.com/page/tackline/
otf - 02 Dec 2005 18:30 GMT
I mean, using a piece of example code like
/*
http://java.sun.com/j2se/1.5.0/docs/api/java/lang/System.html#getProperties()
*/
import java.util.*;
import java.io.*;
public class PropertiesTest{
public static void main(String[] args) throws Exception {
Properties PropsSys = System.getProperties();
// __
Enumeration e = PropsSys.propertyNames();
while(e.hasMoreElements()){
String key = (String)e.nextElement();
String value = PropsSys.getProperty( key );
System.out.println(" ._ " + key + ": " + value );
}
// __
// System.out.println(PropsSys);
}
}
you can get your "os.name", Linux in my case, and "os.version", 2.6.12.
.
But how can you get further into FS features? Say, how can you know if your
FS is using a RAID 0+1 based on ReiserFS4?
.
otf
Chris Smith - 02 Dec 2005 18:50 GMT
> you can get your "os.name", Linux in my case, and "os.version", 2.6.12.
> .
> But how can you get further into FS features? Say, how can you know if your
> FS is using a RAID 0+1 based on ReiserFS4?
You can't.

Signature
www.designacourse.com
The Easiest Way To Train Anyone... Anywhere.
Chris Smith - Lead Software Developer/Technical Trainer
MindIQ Corporation
Roedy Green - 02 Dec 2005 20:05 GMT
> But how can you get further into FS features? Say, how can you know if your
>FS is using a RAID 0+1 based on ReiserFS4?
>.
Java does not provide methods that have no equivalent on other
platforms. For platform specific knowledge, you must use JNI.
see http://mindprod.com/jgloss/jni.html

Signature
Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.
otf - 02 Dec 2005 21:24 GMT
>> But how can you get further into FS features? Say, how can you know if
>> your
[quoted text clipped - 4 lines]
>
> see http://mindprod.com/jgloss/jni.html
well, jni will be used then.
.
I think this "least-common-denominator" featurisation of java's API is
sometimes lacking. Probably java could offer "extensions into the
particular pecualiarties of different FSs" as it does e.g. with JAAS and
the os host's sec. I mean files are definitely more than a name and the
illusion of a bunch of sequencial bytes.
.
java.io is one of the most sensitive APIs
.
and by the way if you are "our" very same Roedy Green. I was/had been very
worried about "you"/your work (its continuation)
.
otf
Roedy Green - 02 Dec 2005 23:14 GMT
> and by the way if you are "our" very same Roedy Green. I was/had been very
>worried about "you"/your work (its continuation)
I was pretty sick yesterday with chills, fever and nausea but that has
passed. I am feeling much better. However, compared with the way I
felt 5 years ago, I am on my last legs. I just have to hope some new
medications will be invented with gentler side effects.
The funny thing is, I look almost normal. Ladies flirt with me at the
supermarket.
One thing I love about Java is the way it focuses the mind. All
personal problems and discomforts disappear in the pursuit of an
elusive bug.

Signature
Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.
Roedy Green - 02 Dec 2005 23:22 GMT
> I think this "least-common-denominator" featurisation of java's API is
>sometimes lacking. Probably java could offer "extensions into the
>particular pecualiarties of different FSs" as it does e.g. with JAAS and
>the os host's sec. I mean files are definitely more than a name and the
>illusion of a bunch of sequencial bytes.
The problem from Sun's point of view is they have to think about ALL
platforms, not just Windows/Linux/Mac. Something has to be fudged for
all the others if they invent an API, which in the example of
Preferences meant giving Java an SQL engine to manage Preferences on
some platforms.
There are a few things I think you should be able to find out without
JNI.
1. mac addressess
2. free disk space give a directory/volume name.
3. name of the computer.
4. State of Internet connection -- on, dialable, none.
5. benchmarking info: CPU model, clock speed, total RAM.
Perhaps the way to do in is write the code for 4 platforms and give it
to Sun, and let them massage it for official releases. With 4 models
to go from, it should be easier to create the rest of the JNI code
needed.
Also recall JVM makers sign up with Sun and agree to implement ALL new
stuff. Sun does not want to burden them and piss them off.

Signature
Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.
otf - 02 Dec 2005 18:30 GMT
I mean, using a piece of example code like
/*
http://java.sun.com/j2se/1.5.0/docs/api/java/lang/System.html#getProperties()
*/
import java.util.*;
import java.io.*;
public class PropertiesTest{
public static void main(String[] args) throws Exception {
Properties PropsSys = System.getProperties();
// __
Enumeration e = PropsSys.propertyNames();
while(e.hasMoreElements()){
String key = (String)e.nextElement();
String value = PropsSys.getProperty( key );
System.out.println(" ._ " + key + ": " + value );
}
// __
// System.out.println(PropsSys);
}
}
you can get your "os.name", Linux in my case, and "os.version", 2.6.12.
.
But how can you get further into FS features? Say, how can you know if your
FS is using a RAID 0+1 based on ReiserFS4?
.
otf
iksrazal@gmail.com - 02 Dec 2005 18:56 GMT
> .
> But how can you get further into FS features? Say, how can you know if your
> FS is using a RAID 0+1 based on ReiserFS4?
> .
> otf
More of a linux kernel question, but check out /sys/class and
/sys/block:
http://lwn.net/Articles/153544/
BTW, as an ocasional user of tripwire - a java implementation would be
one helluva project - but probably a labor of love.
HTH,
iksrazal
blmblm@myrealbox.com - 03 Dec 2005 13:01 GMT
> is there such thing as a version of tripwire implemented in Java?
Oh, in *Java* ....
Off-topic, but "J" is also a programming language, nothing like Java:
http://www.jsoftware.com/
(I know this because someone I work with is a J fan. It's an
interesting langauge, but I've never made the time to get past the
learning curve .... )
| B. L. Massingill
| ObDisclaimer: I don't speak for my employers; they return the favor.