This is a discussion on Jonathan Schilling: Get system data problem in Java within the Sco Unix forums, part of the Unix Operating Systems category; --> I need to get the serial number (3aannnnnn) of a SCO 5.0.x or 6.0.x enterprise system in Java. I ...
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| I need to get the serial number (3aannnnnn) of a SCO 5.0.x or 6.0.x enterprise system in Java. I can get some info in Java such as: System.getProperty("os.name")); However, the serial number System.getProperty eludes me. I can do it in C with: strncpy(sys_ser, unamedata.sysserial, 10); Is there a way to get the serial number in Java direct? Or, can I do some sort of system call to do a: "uname -X > myfile" and open the myfile as a properties file? Or, can I call/link a C program as a subroutine (I assume using a getsn.o file) of Java? Any ideas would be appreciated. Carl |
| |||
| carl@eatontown.net wrote: > I need to get the serial number (3aannnnnn) > of a SCO 5.0.x or 6.0.x enterprise system > in Java. > > I can get some info in Java such as: > System.getProperty("os.name")); > However, the serial number System.getProperty eludes me. > > I can do it in C with: > strncpy(sys_ser, unamedata.sysserial, 10); > > Is there a way to get the serial number in Java direct? > > Or, can I do some sort of system call to do a: > "uname -X > myfile" and open the myfile > as a properties file? > > Or, can I call/link a C program as a subroutine > (I assume using a getsn.o file) of Java? > > Any ideas would be appreciated. > > > > Carl > From the system/shell point of view on SCO OS 5.0.x: grep IQM_ACTIVATION_KEY /var/adm/ISL/iqm_file grep IQM_SERIAL_NUMBER /var/adm/ISL/iqm_file For 6.0.0, haven't tried yet :-( -- Roberto Zini - r.zini<@AT@>strhold.it --------------------------------------------------------------------- "Has anybody around here seen an aircraft carrier?" (Pete "Maverick" Mitchell - Top Gun) |
| |||
| carl@eatontown.net wrote: > I need to get the serial number (3aannnnnn) > of a SCO 5.0.x or 6.0.x enterprise system > in Java. > > I can get some info in Java such as: > System.getProperty("os.name")); > However, the serial number System.getProperty eludes me. > > I can do it in C with: > strncpy(sys_ser, unamedata.sysserial, 10); > > Is there a way to get the serial number in Java direct? > > Or, can I do some sort of system call to do a: > "uname -X > myfile" and open the myfile > as a properties file? > > Or, can I call/link a C program as a subroutine > (I assume using a getsn.o file) of Java? There's no way of doing it in pure Java. Yes, you can call a C subprogram that gets it (see the native methods discussion in /usr/java/ReleaseNotes.html). If it's available from some command, you can invoke that command via the Runtime.getRuntime().exec(some_command) facility. Jonathan Schilling |
| ||||
| jlselsewhere@my-deja.com wrote: > carl@eatontown.net wrote: > > I need to get the serial number (3aannnnnn) > > of a SCO 5.0.x or 6.0.x enterprise system > > in Java. > > > > I can get some info in Java such as: > > System.getProperty("os.name")); > > However, the serial number System.getProperty eludes me. > > > > I can do it in C with: > > strncpy(sys_ser, unamedata.sysserial, 10); > > > > Is there a way to get the serial number in Java direct? > > > > Or, can I do some sort of system call to do a: > > "uname -X > myfile" and open the myfile > > as a properties file? > > > > Or, can I call/link a C program as a subroutine > > (I assume using a getsn.o file) of Java? > > There's no way of doing it in pure Java. > > Yes, you can call a C subprogram that gets it > (see the native methods discussion in > /usr/java/ReleaseNotes.html). If it's available > from some command, you can invoke that command > via the Runtime.getRuntime().exec(some_command) > facility. > > Jonathan Schilling uname -X | grep Serial | cut -d" " -f 3 Should give you the Serial number. Regards...Dan. |