Results 1 to 3 of 3

Thread: How can we get file version information in Linux?

  1. #1
    Join Date
    Feb 2010
    Posts
    31
    Qt products
    Qt4
    Platforms
    Windows

    Default How can we get file version information in Linux?

    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

  2. #2
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,716
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: How can we get file version information in Linux?

    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.
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  3. #3
    Join Date
    Jan 2010
    Posts
    73
    Thanks
    6
    Thanked 8 Times in 8 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How can we get file version information in Linux?

    My first thought was "I wonder how windows knows the file version information". Is this stored
    1. in extended attributes
    2. in the registry
    3. 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/Executa...inkable_Format
    http://developers.sun.com/solaris/articles/elf.html
    http://www.ibm.com/developerworks/li.../l-shlibs.html

Similar Threads

  1. QHttp file information
    By bunjee in forum Qt Programming
    Replies: 1
    Last Post: 31st May 2009, 21:39
  2. Replies: 1
    Last Post: 19th October 2008, 22:30
  3. how to add version information to my program?
    By yleesun in forum Qt Programming
    Replies: 6
    Last Post: 10th October 2008, 11:41
  4. How I can retrive information abt file.
    By safknw in forum General Programming
    Replies: 3
    Last Post: 2nd December 2006, 14:35
  5. Replies: 13
    Last Post: 1st June 2006, 15:01

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.