Prev: add jar to classpath at runtime but not able to access resource in jar
Next: add jar to classpath at runtime but not able to access resource in jar
From: Roedy Green on 20 Apr 2010 10:52 On Tue, 20 Apr 2010 05:18:54 -0700 (PDT), ilya <bumsys(a)gmail.com> wrote, quoted or indirectly quoted someone who said : >Is there the way to get the File Version of Product Version of the >file using java.(for all operation systems)? you can get the version of java.exe you are using by looking at the System properties. See http://mindprod.com/applet/wassup.html for sample code. Young males are not exactly known for their housekeeping skill. These creatures who live on stale pizza, and soft drinks designed the file "system" in the various OSes. It is a hopeless mess. 1. It does not keep track of what sort of data is in a file. 2. it has no clean way of knowing what programs can process it. 3. It has no universal way of tracking which layout version a file is. 4. It does not track what sort of encoding is used in a text file. All you can really do is read up on the spec for each file type of interest, and read the header in binary and pick out the data you need. For example see the code at: http://wush.net/svn/mindprod/com/mindprod/common11/ImageInfo.java -- Roedy Green Canadian Mind Products http://mindprod.com It�s amazing how much structure natural languages have when you consider who speaks them and how they evolved.
From: Roedy Green on 20 Apr 2010 10:57 On Tue, 20 Apr 2010 06:41:54 -0700 (PDT), ilya <bumsys(a)gmail.com> wrote, quoted or indirectly quoted someone who said : >Sorry, but I need the way how to get the file version. For which files >I will decide later. Now I need only for *.dll files.!!! Here are two approaches. 1. load the DLL in C++ and use some C++ Windows method to get its file version. 2. Find a DLL layout spec and find out where they hide the version bits. Navigate to them and extract them. If you are stuck, I could do this for you for a fee. -- Roedy Green Canadian Mind Products http://mindprod.com It�s amazing how much structure natural languages have when you consider who speaks them and how they evolved.
From: Martin Gregorie on 20 Apr 2010 11:29
On Tue, 20 Apr 2010 07:52:32 -0700, Roedy Green wrote: > Young males are not exactly known for their housekeeping skill. These > creatures who live on stale pizza, and soft drinks designed the file > "system" in the various OSes. > > It is a hopeless mess. > > 1. It does not keep track of what sort of data is in a file. > > 2. it has no clean way of knowing what programs can process it. > > 3. It has no universal way of tracking which layout version a file is. > > 4. It does not track what sort of encoding is used in a text file. > That's not strictly true. I know a two or possibly three OS which keep track of all that good stuff (VME/B, OS/400 and possibly OS X). Though its true that the most common OSen (Linux, Unices, DOS/Windows - don't know how IBM big iron does it) rely on personal knowledge or kludges such as MIMETYPE tables or proprietary equivalents. -- martin@ | Martin Gregorie gregorie. | Essex, UK org | |