PDA

View Full Version : How can we get file version information in Linux?



payal
11th February 2010, 09:06
Hi................

I am porting one Qt appllication from windows to linux which is using Win32 functions like GetFileVersionInfoSize(),GetFileVersionInfo() and VerQueryValue() for getting file version information.

is there any equivalent functions in linux to get file version information?

I came to know that we are getting version info from version.dll in Windows.....is it possible to make use use of that dll by installing Winelib in Linux?

Plz provide me some answers........

Regards,
Payal

high_flyer
11th February 2010, 09:24
I don't know for sure, but I don't think the linux file systems have such a thing as savaing file version info in them.
The way I know is by naming the libs with their corresponding version numbers.
If I am correct, then you better just put the code associated with these function under #ifdef WIN32.
Another way could be to override these function to retrieve the version number from the lib file name.

pitonyak
11th February 2010, 15:46
My first thought was "I wonder how windows knows the file version information". Is this stored

in extended attributes
in the registry
in the file itself

I doubt that this is stored in extended attributes, because I believe that this works on file systems that do not support extended attributes. DLLs have version information stored in the file itself, so to function, the method must be able to look inside the DLL. I expect the same to be true of EXE files.

Now, if you move to Linux, how do they store information? Check these links

http://www.linuxjournal.com/article/1059
http://en.wikipedia.org/wiki/Executable_and_Linkable_Format
http://developers.sun.com/solaris/articles/elf.html
http://www.ibm.com/developerworks/linux/library/l-shlibs.html